Skip to content

Instantly share code, notes, and snippets.

@andrewhl
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewhl/bb9303f0c0cd479c759a to your computer and use it in GitHub Desktop.
Save andrewhl/bb9303f0c0cd479c759a to your computer and use it in GitHub Desktop.
PHP Catchable fatal error: Argument 1 passed to SignUpCest::__construct() must be an instance of MyApp\TestHelpers\SignUpHelper, none given, called in /Users/andrew/code/myapp/vendor/codeception/codeception/src/Codeception/TestLoader.php on line 142 and defined in /Users/andrew/code/myapp/tests/acceptance/SignupCest.php on line 17
Catchable fatal error: Argument 1 passed to SignUpCest::__construct() must be an instance of MyApp\TestHelpers\SignUpHelper, none given, called in /Users/andrew/code/myapp/vendor/codeception/codeception/src/Codeception/TestLoader.php on line 142 and defined in /Users/andrew/code/myapp/tests/acceptance/SignupCest.php on line 17
<?php
use \AcceptanceTester;
use MyApp\TestHelpers\NavBarHelper;
use MyApp\TestHelpers\SignUpHelper;
class SignUpCest {
/**
* @var SignUpHelper
*/
private $signUpHelper;
/**
* @var NavBarHelper
*/
private $navBarHelper;
function __construct(SignUpHelper $signUpHelper, NavBarHelper $navBarHelper)
{
$this->signUp = $signUpHelper;
$this->navBar = $navBarHelper;
}
public function _before()
{
$I->amOnPage('/');
}
public function _after()
{
}
// tests
public function signUp(AcceptanceTester $I)
{
$I->wantTo('sign up');
$this->navBar->click('Sign up');
$this->signUp->register([
'first_name' => 'Joe',
'last_name' => 'Jones',
'email' => 'joe@jones.com',
'password' => '1234',
'password_confirmation' => '1234'
]);
}
public function alreadySignedUp(AcceptanceTester $I)
{
$I->expectTo('be already signed up');
$this->signUp->shouldExist([
'first_name' => 'Joe',
'last_name' => 'Jones',
'email' => 'joe@jones.com',
'password' => '1234',
'password_confirmation' => '1234'
], 'The email has already been taken.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment