assertEquals(5, $element->getChildrenCount()); * ``` * * Floating-point example: * ```php * assertEquals(0.3, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01); * ``` * * @param $expected * @param $actual * @param string $message * @param float $delta * @see \Codeception\Module\Asserts::assertEquals() */ public function assertEquals($expected, $actual, $message = null, $delta = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that two variables are not equal. If you're comparing floating-point values, * you can specify the optional "delta" parameter which dictates how great of a precision * error are you willing to tolerate in order to consider the two values not equal. * * Regular example: * ```php * assertNotEquals(0, $element->getChildrenCount()); * ``` * * Floating-point example: * ```php * assertNotEquals(0.4, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01); * ``` * * @param $expected * @param $actual * @param string $message * @param float $delta * @see \Codeception\Module\Asserts::assertNotEquals() */ public function assertNotEquals($expected, $actual, $message = null, $delta = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that two variables are same * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertSame() */ public function assertSame($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that two variables are not same * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertNotSame() */ public function assertNotSame($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that actual is greater than expected * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertGreaterThan() */ public function assertGreaterThan($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that actual is greater or equal than expected * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() */ public function assertGreaterThanOrEqual($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that actual is less than expected * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertLessThan() */ public function assertLessThan($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that actual is less or equal than expected * * @param $expected * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertLessThanOrEqual() */ public function assertLessThanOrEqual($expected, $actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that haystack contains needle * * @param $needle * @param $haystack * @param string $message * @see \Codeception\Module\Asserts::assertContains() */ public function assertContains($needle, $haystack, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that haystack doesn't contain needle. * * @param $needle * @param $haystack * @param string $message * @see \Codeception\Module\Asserts::assertNotContains() */ public function assertNotContains($needle, $haystack, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that string match with pattern * * @param string $pattern * @param string $string * @param string $message * @see \Codeception\Module\Asserts::assertRegExp() */ public function assertRegExp($pattern, $string, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that string not match with pattern * * @param string $pattern * @param string $string * @param string $message * @see \Codeception\Module\Asserts::assertNotRegExp() */ public function assertNotRegExp($pattern, $string, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that a string starts with the given prefix. * * @param string $prefix * @param string $string * @param string $message * @see \Codeception\Module\Asserts::assertStringStartsWith() */ public function assertStringStartsWith($prefix, $string, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that a string doesn't start with the given prefix. * * @param string $prefix * @param string $string * @param string $message * @see \Codeception\Module\Asserts::assertStringStartsNotWith() */ public function assertStringStartsNotWith($prefix, $string, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that variable is empty. * * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertEmpty() */ public function assertEmpty($actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that variable is not empty. * * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertNotEmpty() */ public function assertNotEmpty($actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that variable is NULL * * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertNull() */ public function assertNull($actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that variable is not NULL * * @param $actual * @param string $message * @see \Codeception\Module\Asserts::assertNotNull() */ public function assertNotNull($actual, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that condition is positive. * * @param $condition * @param string $message * @see \Codeception\Module\Asserts::assertTrue() */ public function assertTrue($condition, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that the condition is NOT true (everything but true) * * @param $condition * @param string $message * @see \Codeception\Module\Asserts::assertNotTrue() */ public function assertNotTrue($condition, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that condition is negative. * * @param $condition * @param string $message * @see \Codeception\Module\Asserts::assertFalse() */ public function assertFalse($condition, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that the condition is NOT false (everything but false) * * @param $condition * @param string $message * @see \Codeception\Module\Asserts::assertNotFalse() */ public function assertNotFalse($condition, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks if file exists * * @param string $filename * @param string $message * @see \Codeception\Module\Asserts::assertFileExists() */ public function assertFileExists($filename, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks if file doesn't exist * * @param string $filename * @param string $message * @see \Codeception\Module\Asserts::assertFileNotExists() */ public function assertFileNotExists($filename, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $expected * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertGreaterOrEquals() */ public function assertGreaterOrEquals($expected, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $expected * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertLessOrEquals() */ public function assertLessOrEquals($expected, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertIsEmpty() */ public function assertIsEmpty($actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $key * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertArrayHasKey() */ public function assertArrayHasKey($key, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $key * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertArrayNotHasKey() */ public function assertArrayNotHasKey($key, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that array contains subset. * * @param array $subset * @param array $array * @param bool $strict * @param string $message * @see \Codeception\Module\Asserts::assertArraySubset() */ public function assertArraySubset($subset, $array, $strict = null, $message = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArraySubset', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $expectedCount * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertCount() */ public function assertCount($expectedCount, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $class * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertInstanceOf() */ public function assertInstanceOf($class, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $class * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertNotInstanceOf() */ public function assertNotInstanceOf($class, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * @param $type * @param $actual * @param $description * @see \Codeception\Module\Asserts::assertInternalType() */ public function assertInternalType($type, $actual, $description = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Fails the test with message. * * @param $message * @see \Codeception\Module\Asserts::fail() */ public function fail($message) { return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Handles and checks exception called inside callback function. * Either exception class name or exception instance should be provided. * * ```php * expectException(MyException::class, function() { * $this->doSomethingBad(); * }); * * $I->expectException(new MyException(), function() { * $this->doSomethingBad(); * }); * ``` * If you want to check message or exception code, you can pass them with exception instance: * ```php * expectException(new MyException("Don't do bad things"), function() { * $this->doSomethingBad(); * }); * ``` * * @param $exception string or \Exception * @param $callback * * @deprecated Use expectThrowable instead * @see \Codeception\Module\Asserts::expectException() */ public function expectException($exception, $callback) { return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Handles and checks throwables (Exceptions/Errors) called inside the callback function. * Either throwable class name or throwable instance should be provided. * * ```php * expectThrowable(MyThrowable::class, function() { * $this->doSomethingBad(); * }); * * $I->expectThrowable(new MyException(), function() { * $this->doSomethingBad(); * }); * ``` * If you want to check message or throwable code, you can pass them with throwable instance: * ```php * expectThrowable(new MyError("Don't do bad things"), function() { * $this->doSomethingBad(); * }); * ``` * * @param $throwable string or \Throwable * @param $callback * @see \Codeception\Module\Asserts::expectThrowable() */ public function expectThrowable($throwable, $callback) { return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Authorizes user on a site without submitting login form. * Use it for fast pragmatic authorization in functional tests. * * ```php * amLoggedInAs(1); * * // User object is passed as parameter * $admin = \app\models\User::findByUsername('admin'); * $I->amLoggedInAs($admin); * ``` * Requires `user` component to be enabled and configured. * * @param $user * @throws ModuleException * @see \Codeception\Module\Yii2::amLoggedInAs() */ public function amLoggedInAs($user) { return $this->getScenario()->runStep(new \Codeception\Step\Condition('amLoggedInAs', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Creates and loads fixtures from a config. * Signature is the same as for `fixtures()` method of `yii\test\FixtureTrait` * * ```php * haveFixtures([ * 'posts' => PostsFixture::className(), * 'user' => [ * 'class' => UserFixture::className(), * 'dataFile' => '@tests/_data/models/user.php', * ], * ]); * ``` * * Note: if you need to load fixtures before the test (probably before the cleanup transaction is started; * `cleanup` options is `true` by default), you can specify fixtures with _fixtures method of a testcase * ```php * [ * 'class' => UserFixture::className(), * 'dataFile' => codecept_data_dir() . 'user.php' * ] * ]; * } * ``` * instead of defining `haveFixtures` in Cest `_before` * * @param $fixtures * @part fixtures * @see \Codeception\Module\Yii2::haveFixtures() */ public function haveFixtures($fixtures) { return $this->getScenario()->runStep(new \Codeception\Step\Action('haveFixtures', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Returns all loaded fixtures. * Array of fixture instances * * @part fixtures * @return array * @see \Codeception\Module\Yii2::grabFixtures() */ public function grabFixtures() { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFixtures', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Gets a fixture by name. * Returns a Fixture instance. If a fixture is an instance of `\yii\test\BaseActiveFixture` a second parameter * can be used to return a specific model: * * ```php * haveFixtures(['users' => UserFixture::className()]); * * $users = $I->grabFixture('users'); * * // get first user by key, if a fixture is instance of ActiveFixture * $user = $I->grabFixture('users', 'user1'); * ``` * * @param $name * @return mixed * @throws ModuleException if a fixture is not found * @part fixtures * @see \Codeception\Module\Yii2::grabFixture() */ public function grabFixture($name, $index = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFixture', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Inserts record into the database. * * ``` php * haveRecord('app\models\User', array('name' => 'Davert')); * ?> * ``` * * @param $model * @param array $attributes * @return mixed * @part orm * @see \Codeception\Module\Yii2::haveRecord() */ public function haveRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('haveRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that record exists in database. * * ``` php * $I->seeRecord('app\models\User', array('name' => 'davert')); * ``` * * @param $model * @param array $attributes * @part orm * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\Yii2::seeRecord() */ public function canSeeRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that record exists in database. * * ``` php * $I->seeRecord('app\models\User', array('name' => 'davert')); * ``` * * @param $model * @param array $attributes * @part orm * @see \Codeception\Module\Yii2::seeRecord() */ public function seeRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that record does not exist in database. * * ``` php * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); * ``` * * @param $model * @param array $attributes * @part orm * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\Yii2::dontSeeRecord() */ public function cantSeeRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that record does not exist in database. * * ``` php * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); * ``` * * @param $model * @param array $attributes * @part orm * @see \Codeception\Module\Yii2::dontSeeRecord() */ public function dontSeeRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Retrieves record from database * * ``` php * $category = $I->grabRecord('app\models\User', array('name' => 'davert')); * ``` * * @param $model * @param array $attributes * @return mixed * @part orm * @see \Codeception\Module\Yii2::grabRecord() */ public function grabRecord($model, $attributes = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabRecord', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Similar to amOnPage but accepts route as first argument and params as second * * ``` * $I->amOnRoute('site/view', ['page' => 'about']); * ``` * * @see \Codeception\Module\Yii2::amOnRoute() */ public function amOnRoute($route, $params = null) { return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnRoute', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Gets a component from Yii container. Throws exception if component is not available * * ```php * grabComponent('mailer'); * ``` * * @param $component * @return mixed * @throws ModuleException * @deprecated in your tests you can use \Yii::$app directly. * @see \Codeception\Module\Yii2::grabComponent() */ public function grabComponent($component) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabComponent', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that email is sent. * * ```php * seeEmailIsSent(); * * // check that only 3 emails were sent * $I->seeEmailIsSent(3); * ``` * * @param int $num * @throws ModuleException * @part email * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\Yii2::seeEmailIsSent() */ public function canSeeEmailIsSent($num = null) { return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeEmailIsSent', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that email is sent. * * ```php * seeEmailIsSent(); * * // check that only 3 emails were sent * $I->seeEmailIsSent(3); * ``` * * @param int $num * @throws ModuleException * @part email * @see \Codeception\Module\Yii2::seeEmailIsSent() */ public function seeEmailIsSent($num = null) { return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeEmailIsSent', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that no email was sent * * @part email * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\Yii2::dontSeeEmailIsSent() */ public function cantSeeEmailIsSent() { return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeEmailIsSent', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that no email was sent * * @part email * @see \Codeception\Module\Yii2::dontSeeEmailIsSent() */ public function dontSeeEmailIsSent() { return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeEmailIsSent', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Returns array of all sent email messages. * Each message implements `yii\mail\MessageInterface` interface. * Useful to perform additional checks using `Asserts` module: * * ```php * seeEmailIsSent(); * $messages = $I->grabSentEmails(); * $I->assertEquals('admin@site,com', $messages[0]->getTo()); * ``` * * @part email * @return array * @throws ModuleException * @see \Codeception\Module\Yii2::grabSentEmails() */ public function grabSentEmails() { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabSentEmails', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Returns last sent email: * * ```php * seeEmailIsSent(); * $message = $I->grabLastSentEmail(); * $I->assertEquals('admin@site,com', $message->getTo()); * ``` * @part email * @see \Codeception\Module\Yii2::grabLastSentEmail() */ public function grabLastSentEmail() { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabLastSentEmail', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Returns a list of regex patterns for recognized domain names * * @return array * @see \Codeception\Module\Yii2::getInternalDomains() */ public function getInternalDomains() { return $this->getScenario()->runStep(new \Codeception\Step\Action('getInternalDomains', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Sets a cookie and, if validation is enabled, signs it. * @param string $name The name of the cookie * @param string $value The value of the cookie * @param array $params Additional cookie params like `domain`, `path`, `expires` and `secure`. * @see \Codeception\Module\Yii2::setCookie() */ public function setCookie($name, $val, $params = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * This function creates the CSRF Cookie. * @param string $val The value of the CSRF token * @return string[] Returns an array containing the name of the CSRF param and the masked CSRF token. * @see \Codeception\Module\Yii2::createAndSetCsrfCookie() */ public function createAndSetCsrfCookie($val) { return $this->getScenario()->runStep(new \Codeception\Step\Action('createAndSetCsrfCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Authenticates user for HTTP_AUTH * * @param $username * @param $password * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() */ public function amHttpAuthenticated($username, $password) { return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Sets the HTTP header to the passed value - which is used on * subsequent HTTP requests through PhpBrowser. * * Example: * ```php * haveHttpHeader('X-Requested-With', 'Codeception'); * $I->amOnPage('test-headers.php'); * ?> * ``` * * To use special chars in Header Key use HTML Character Entities: * Example: * Header with underscore - 'Client_Id' * should be represented as - 'Client_Id' or 'Client_Id' * * ```php * haveHttpHeader('Client_Id', 'Codeception'); * ?> * ``` * * @param string $name the name of the request header * @param string $value the value to set it to for subsequent * requests * @see \Codeception\Lib\InnerBrowser::haveHttpHeader() */ public function haveHttpHeader($name, $value) { return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Deletes the header with the passed name. Subsequent requests * will not have the deleted header in its request. * * Example: * ```php * haveHttpHeader('X-Requested-With', 'Codeception'); * $I->amOnPage('test-headers.php'); * // ... * $I->deleteHeader('X-Requested-With'); * $I->amOnPage('some-other-page.php'); * ?> * ``` * * @param string $name the name of the header to delete. * @see \Codeception\Lib\InnerBrowser::deleteHeader() */ public function deleteHeader($name) { return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Opens the page for the given relative URI. * * ``` php * amOnPage('/'); * // opens /register page * $I->amOnPage('/register'); * ``` * * @param string $page * @see \Codeception\Lib\InnerBrowser::amOnPage() */ public function amOnPage($page) { return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Perform a click on a link or a button, given by a locator. * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. * For buttons, the "value" attribute, "name" attribute, and inner text are searched. * For links, the link text is searched. * For images, the "alt" attribute and inner text of any parent links are searched. * * The second parameter is a context (CSS or XPath locator) to narrow the search. * * Note that if the locator matches a button of type `submit`, the form will be submitted. * * ``` php * click('Logout'); * // button of form * $I->click('Submit'); * // CSS button * $I->click('#form input[type=submit]'); * // XPath * $I->click('//form/*[@type="submit"]'); * // link in context * $I->click('Logout', '#nav'); * // using strict locator * $I->click(['link' => 'Login']); * ?> * ``` * * @param $link * @param $context * @see \Codeception\Lib\InnerBrowser::click() */ public function click($link, $context = null) { return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * Checks that the current page contains the given string (case insensitive). * * You can specify a specific HTML element (via CSS or XPath) as the second * parameter to only search within that element. * * ``` php * see('Logout'); // I can suppose user is logged in * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page * $I->see('Sign Up', '//body/h1'); // with XPath * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator * ``` * * Note that the search is done after stripping all HTML tags from the body, * so `$I->see('strong')` will return true for strings like: * * - `
I am Stronger than thou
` * - `` * * But will *not* be true for strings like: * * - `Home` * - `I am Stronger than thou
` * - `` * * But will *not* be true for strings like: * * - `Home` * - `I am Stronger than thou
` * - `` * * But will ignore strings like: * * - `Home` * - `I am Stronger than thou
` * - `` * * But will ignore strings like: * * - `Home` * - `