Last active
August 29, 2015 14:02
-
-
Save andrewhl/bb9303f0c0cd479c759a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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