diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d114f5..c60b219 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,12 +34,8 @@ jobs: run: ddev exec bin/phpunit -c public/typo3conf/ext/flogin/Tests/Build/FunctionalTests.xml - name: Acceptance General - run: ddev exec bin/codecept run acceptance -f -c public/typo3conf/ext/flogin/Tests/codeception.yml --env github - - - name: Acceptance API - run: ddev exec bin/codecept run acceptance -f -c public/typo3conf/ext/flogin/Tests/api.suite.yml --env github - if: ${{ false }} + run: ddev exec bin/codecept run acceptance -f -vvv -c public/typo3conf/ext/flogin/Tests/codeception.yml --env github - name: Acceptance Backend - run: ddev exec bin/codecept run acceptance -f -c public/typo3conf/ext/flogin/Tests/Backend.suite.yml --env github + run: ddev exec bin/codecept run acceptance -f -vvv -c public/typo3conf/ext/flogin/Tests/Backend.suite.yml --env github if: ${{ false }} diff --git a/Classes/Controller/UserApiController.php b/Classes/Controller/UserApiController.php index d5007ec..aae9222 100644 --- a/Classes/Controller/UserApiController.php +++ b/Classes/Controller/UserApiController.php @@ -48,11 +48,11 @@ public function currentAction(): ResponseInterface { $authUid = (int)$this->context->getPropertyFromAspect('frontend.user', 'id'); - $user = $this->userRepository->findByUid($authUid); - - $json = json_encode($user->_getProperties()); + if ($user = $this->userRepository->findByUid($authUid)) { + $json = (string)json_encode($user->_getProperties()); + } - return $this->jsonResponse($json); + return $this->jsonResponse($json ?? ''); } /** diff --git a/Classes/Support/TypoScript.php b/Classes/Support/TypoScript.php index 3a5bd1a..dfeb89e 100644 --- a/Classes/Support/TypoScript.php +++ b/Classes/Support/TypoScript.php @@ -45,7 +45,7 @@ public static function getView(): array { $ts = self::retrieveFullTypoScriptConfigurationFor('tx_flogin'); - return (array)$ts['view.'] ?: []; + return (array)$ts['view.']; } public static function getSettings(): array @@ -69,7 +69,7 @@ public static function retrieveFullTypoScriptConfigurationFor(string $extensionK return []; } - return $ts['plugin.'][$extensionKey . '.'] ?: []; + return $ts['plugin.'][$extensionKey . '.'] ?? []; } /** diff --git a/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php b/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php index d486e1e..bd43241 100644 --- a/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php +++ b/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php @@ -1,4 +1,4 @@ -haveHttpHeader('Content-Type', 'application/json'); - * // all next requests will contain this header - * ?> + * $I->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 $name + * @deprecated Use expectThrowable() instead + * @param \Exception|string $exception + * @param callable $callback + * @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 $throwable + * @param callable $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. + * + * Asserts that a file does not exist. + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileNotExists() + */ + public function assertFileNotExists($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is greater than or equal to another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertGreaterOrEquals() + */ + public function assertGreaterOrEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsEmpty() + */ + public function assertIsEmpty($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is smaller than or equal to another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertLessOrEquals() + */ + public function assertLessOrEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string does not match a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotRegExp() + */ + public function assertNotRegExp($pattern, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string matches a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertRegExp() + */ + public function assertRegExp($pattern, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Evaluates a PHPUnit\Framework\Constraint matcher object. + * * @param $value - * @part json - * @part xml - * @see \Codeception\Module\REST::haveHttpHeader() + * @param Constraint $constraint + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertThatItsNot() + */ + public function assertThatItsNot($value, $constraint, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThatItsNot', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that an array has a specified key. + * + * @param int|string $key + * @param array|ArrayAccess $array + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertArrayHasKey() + */ + public function assertArrayHasKey($key, $array, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that an array does not have a specified key. + * + * @param int|string $key + * @param array|ArrayAccess $array + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertArrayNotHasKey() + */ + public function assertArrayNotHasKey($key, $array, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a class has a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertClassHasAttribute() + */ + public function assertClassHasAttribute($attributeName, $className, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a class has a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertClassHasStaticAttribute() + */ + public function assertClassHasStaticAttribute($attributeName, $className, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasStaticAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a class does not have a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertClassNotHasAttribute() + */ + public function assertClassNotHasAttribute($attributeName, $className, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a class does not have a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertClassNotHasStaticAttribute() + */ + public function assertClassNotHasStaticAttribute($attributeName, $className, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasStaticAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a haystack contains a needle. + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertContains() + */ + public function assertContains($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertContainsEquals() + */ + public function assertContainsEquals($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a haystack contains only values of a given type. + * + * @param string $type + * @param $haystack + * @param bool|null $isNativeType + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertContainsOnly() + */ + public function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnly', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a haystack contains only instances of a given class name. + * + * @param string $className + * @param $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertContainsOnlyInstancesOf() + */ + public function assertContainsOnlyInstancesOf($className, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnlyInstancesOf', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts the number of elements of an array, Countable or Traversable. + * + * @param int $expectedCount + * @param Countable|iterable $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertCount() + */ + public function assertCount($expectedCount, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory does not exist. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryDoesNotExist() + */ + public function assertDirectoryDoesNotExist($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryDoesNotExist', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory exists. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryExists() + */ + public function assertDirectoryExists($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryExists', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory exists and is not readable. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsNotReadable() + */ + public function assertDirectoryIsNotReadable($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory exists and is not writable. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsNotWritable() + */ + public function assertDirectoryIsNotWritable($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory exists and is readable. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsReadable() + */ + public function assertDirectoryIsReadable($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a directory exists and is writable. + * + * @param string $directory + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsWritable() + */ + public function assertDirectoryIsWritable($directory, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string does not match a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertDoesNotMatchRegularExpression() + */ + public function assertDoesNotMatchRegularExpression($pattern, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDoesNotMatchRegularExpression', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertEmpty() + */ + public function assertEmpty($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are equal. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertEquals() + */ + public function assertEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are equal (canonicalizing). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertEqualsCanonicalizing() + */ + public function assertEqualsCanonicalizing($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are equal (ignoring case). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertEqualsIgnoringCase() + */ + public function assertEqualsIgnoringCase($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are equal (with delta). + * + * @param $expected + * @param $actual + * @param float $delta + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertEqualsWithDelta() + */ + public function assertEqualsWithDelta($expected, $actual, $delta, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a condition is false. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFalse() + */ + public function assertFalse($condition, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file does not exist. + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileDoesNotExist() + */ + public function assertFileDoesNotExist($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileDoesNotExist', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is equal to the contents of another file. + * + * @param string $expected + * @param string $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileEquals() + */ + public function assertFileEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is equal to the contents of another file (canonicalizing). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileEqualsCanonicalizing() + */ + public function assertFileEqualsCanonicalizing($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is equal to the contents of another file (ignoring case). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileEqualsIgnoringCase() + */ + public function assertFileEqualsIgnoringCase($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file exists. + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileExists() + */ + public function assertFileExists($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file exists and is not readable. + * + * @param string $file + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileIsNotReadable() + */ + public function assertFileIsNotReadable($file, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file exists and is not writable. + * + * @param string $file + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileIsNotWritable() + */ + public function assertFileIsNotWritable($file, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file exists and is readable. + * + * @param string $file + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileIsReadable() + */ + public function assertFileIsReadable($file, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file exists and is writable. + * + * @param string $file + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileIsWritable() + */ + public function assertFileIsWritable($file, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is not equal to the contents of another file. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileNotEquals() + */ + public function assertFileNotEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is not equal to the contents of another file (canonicalizing). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileNotEqualsCanonicalizing() + */ + public function assertFileNotEqualsCanonicalizing($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of one file is not equal to the contents of another file (ignoring case). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFileNotEqualsIgnoringCase() + */ + public function assertFileNotEqualsIgnoringCase($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is finite. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertFinite() + */ + public function assertFinite($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFinite', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is greater than another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertGreaterThan() + */ + public function assertGreaterThan($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is greater than or equal to another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertGreaterThanOrEqual() + */ + public function assertGreaterThanOrEqual($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is infinite. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertInfinite() + */ + public function assertInfinite($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInfinite', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of a given type. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertInstanceOf() + */ + public function assertInstanceOf($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type array. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsArray() + */ + public function assertIsArray($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type bool. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsBool() + */ + public function assertIsBool($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type callable. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsCallable() + */ + public function assertIsCallable($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type resource and is closed. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsClosedResource() + */ + public function assertIsClosedResource($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsClosedResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type float. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsFloat() + */ + public function assertIsFloat($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type int. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsInt() + */ + public function assertIsInt($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type iterable. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsIterable() + */ + public function assertIsIterable($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsIterable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type array. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotArray() + */ + public function assertIsNotArray($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type bool. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotBool() + */ + public function assertIsNotBool($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type callable. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotCallable() + */ + public function assertIsNotCallable($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type resource. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotClosedResource() + */ + public function assertIsNotClosedResource($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotClosedResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type float. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotFloat() + */ + public function assertIsNotFloat($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type int. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotInt() + */ + public function assertIsNotInt($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type iterable. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotIterable() + */ + public function assertIsNotIterable($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotIterable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type numeric. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotNumeric() + */ + public function assertIsNotNumeric($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type object. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotObject() + */ + public function assertIsNotObject($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file/dir exists and is not readable. + * + * @param string $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotReadable() + */ + public function assertIsNotReadable($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type resource. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotResource() + */ + public function assertIsNotResource($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type scalar. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotScalar() + */ + public function assertIsNotScalar($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of type string. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotString() + */ + public function assertIsNotString($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file/dir exists and is not writable. + * + * @param $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNotWritable() + */ + public function assertIsNotWritable($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type numeric. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsNumeric() + */ + public function assertIsNumeric($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type object. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsObject() + */ + public function assertIsObject($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file/dir is readable. + * + * @param $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsReadable() + */ + public function assertIsReadable($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsReadable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type resource. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsResource() + */ + public function assertIsResource($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type scalar. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsScalar() + */ + public function assertIsScalar($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is of type string. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsString() + */ + public function assertIsString($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a file/dir exists and is writable. + * + * @param $filename + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertIsWritable() + */ + public function assertIsWritable($filename, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsWritable', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string is a valid JSON string. + * + * @param string $actualJson + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJson() + */ + public function assertJson($actualJson, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJson', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two JSON files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonFileEqualsJsonFile() + */ + public function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileEqualsJsonFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two JSON files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonFileNotEqualsJsonFile() + */ + public function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileNotEqualsJsonFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the generated JSON encoded object and the content of the given file are equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonStringEqualsJsonFile() + */ + public function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two given JSON encoded objects or arrays are equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonStringEqualsJsonString() + */ + public function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the generated JSON encoded object and the content of the given file are not equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonStringNotEqualsJsonFile() + */ + public function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two given JSON encoded objects or arrays are not equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertJsonStringNotEqualsJsonString() + */ + public function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is smaller than another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertLessThan() + */ + public function assertLessThan($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a value is smaller than or equal to another value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertLessThanOrEqual() + */ + public function assertLessThanOrEqual($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string matches a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertMatchesRegularExpression() + */ + public function assertMatchesRegularExpression($pattern, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertMatchesRegularExpression', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is nan. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNan() + */ + public function assertNan($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a haystack does not contain a needle. + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotContains() + */ + public function assertNotContains($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\AbstractAsserts::assertNotContainsEquals() + */ + public function assertNotContainsEquals($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a haystack does not contain only values of a given type. + * + * @param string $type + * @param $haystack + * @param bool|null $isNativeType + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotContainsOnly() + */ + public function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsOnly', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts the number of elements of an array, Countable or Traversable. + * + * @param int $expectedCount + * @param Countable|iterable $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotCount() + */ + public function assertNotCount($expectedCount, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotCount', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotEmpty() + */ + public function assertNotEmpty($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are not equal. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotEquals() + */ + public function assertNotEquals($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are not equal (canonicalizing). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotEqualsCanonicalizing() + */ + public function assertNotEqualsCanonicalizing($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are not equal (ignoring case). + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotEqualsIgnoringCase() + */ + public function assertNotEqualsIgnoringCase($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables are not equal (with delta). + * + * @param $expected + * @param $actual + * @param float $delta + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotEqualsWithDelta() + */ + public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a condition is not false. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotFalse() + */ + public function assertNotFalse($condition, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not of a given type. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotInstanceOf() + */ + public function assertNotInstanceOf($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is not null. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotNull() + */ + public function assertNotNull($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables do not have the same type and value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotSame() + */ + public function assertNotSame($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same. + * + * @param Countable|iterable $expected + * @param Countable|iterable $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotSameSize() + */ + public function assertNotSameSize($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSameSize', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a condition is not true. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNotTrue() + */ + public function assertNotTrue($condition, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a variable is null. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertNull() + */ + public function assertNull($actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that an object has a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertObjectHasAttribute() + */ + public function assertObjectHasAttribute($attributeName, $object, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectHasAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that an object does not have a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertObjectNotHasAttribute() + */ + public function assertObjectNotHasAttribute($attributeName, $object, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectNotHasAttribute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two variables have the same type and value. + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertSame() + */ + public function assertSame($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same. + * + * @param Countable|iterable $expected + * @param Countable|iterable $actual + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertSameSize() + */ + public function assertSameSize($expected, $actual, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSameSize', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param string $needle + * @param string $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringContainsString() + */ + public function assertStringContainsString($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * + * @see \Codeception\Module\AbstractAsserts::assertStringContainsStringIgnoringCase() + */ + public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string ends not with a given suffix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringEndsNotWith() + */ + public function assertStringEndsNotWith($suffix, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string ends with a given suffix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringEndsWith() + */ + public function assertStringEndsWith($suffix, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is equal to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFile() + */ + public function assertStringEqualsFile($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is equal to the contents of a file (canonicalizing). + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFileCanonicalizing() + */ + public function assertStringEqualsFileCanonicalizing($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is equal to the contents of a file (ignoring case). + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFileIgnoringCase() + */ + public function assertStringEqualsFileIgnoringCase($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string matches a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringMatchesFormat() + */ + public function assertStringMatchesFormat($format, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string matches a given format file. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringMatchesFormatFile() + */ + public function assertStringMatchesFormatFile($formatFile, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormatFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param string $needle + * @param string $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotContainsString() + */ + public function assertStringNotContainsString($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param string $needle + * @param string $haystack + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotContainsStringIgnoringCase() + */ + public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is not equal to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFile() + */ + public function assertStringNotEqualsFile($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is not equal to the contents of a file (canonicalizing). + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFileCanonicalizing() + */ + public function assertStringNotEqualsFileCanonicalizing($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileCanonicalizing', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that the contents of a string is not equal to the contents of a file (ignoring case). + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFileIgnoringCase() + */ + public function assertStringNotEqualsFileIgnoringCase($expectedFile, $actualString, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileIgnoringCase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string does not match a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotMatchesFormat() + */ + public function assertStringNotMatchesFormat($format, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string does not match a given format string. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringNotMatchesFormatFile() + */ + public function assertStringNotMatchesFormatFile($formatFile, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormatFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string starts not with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringStartsNotWith() + */ + public function assertStringStartsNotWith($prefix, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a string starts with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertStringStartsWith() + */ + public function assertStringStartsWith($prefix, $string, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Evaluates a PHPUnit\Framework\Constraint matcher object. + * + * @param $value + * @param Constraint $constraint + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertThat() + */ + public function assertThat($value, $constraint, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThat', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that a condition is true. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertTrue() + */ + public function assertTrue($condition, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlFileEqualsXmlFile() + */ + public function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileEqualsXmlFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlFileNotEqualsXmlFile() + */ + public function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileNotEqualsXmlFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML documents are equal. + * + * @param string $expectedFile + * @param DOMDocument|string $actualXml + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlStringEqualsXmlFile() + */ + public function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML documents are equal. + * + * @param DOMDocument|string $expectedXml + * @param DOMDocument|string $actualXml + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlStringEqualsXmlString() + */ + public function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML documents are not equal. + * + * @param string $expectedFile + * @param DOMDocument|string $actualXml + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlStringNotEqualsXmlFile() + */ + public function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that two XML documents are not equal. + * + * @param DOMDocument|string $expectedXml + * @param DOMDocument|string $actualXml + * @param string $message + * @see \Codeception\Module\AbstractAsserts::assertXmlStringNotEqualsXmlString() + */ + public function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlString', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Fails a test with the given message. + * + * @param string $message + * @see \Codeception\Module\AbstractAsserts::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. + * + * Mark the test as incomplete. + * + * @param string $message + * @see \Codeception\Module\AbstractAsserts::markTestIncomplete() + */ + public function markTestIncomplete($message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestIncomplete', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Mark the test as skipped. + * + * @param string $message + * @see \Codeception\Module\AbstractAsserts::markTestSkipped() + */ + public function markTestSkipped($message = "") { + return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestSkipped', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Make sure you are connected to the right database. + * + * ```php + * seeNumRecords(2, 'users'); //executed on default database + * $I->amConnectedToDatabase('db_books'); + * $I->seeNumRecords(30, 'books'); //executed on db_books database + * //All the next queries will be on db_books + * ``` + * @param $databaseKey + * @throws ModuleConfigException + * @see \Codeception\Module\Db::amConnectedToDatabase() + */ + public function amConnectedToDatabase($databaseKey) { + return $this->getScenario()->runStep(new \Codeception\Step\Condition('amConnectedToDatabase', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Can be used with a callback if you don't want to change the current database in your test. + * + * ```php + * seeNumRecords(2, 'users'); //executed on default database + * $I->performInDatabase('db_books', function($I) { + * $I->seeNumRecords(30, 'books'); //executed on db_books database + * }); + * $I->seeNumRecords(2, 'users'); //executed on default database + * ``` + * List of actions can be pragmatically built using `Codeception\Util\ActionSequence`: + * + * ```php + * performInDatabase('db_books', ActionSequence::build() + * ->seeNumRecords(30, 'books') + * ); + * ``` + * Alternatively an array can be used: + * + * ```php + * $I->performInDatabase('db_books', ['seeNumRecords' => [30, 'books']]); + * ``` + * + * Choose the syntax you like the most and use it, + * + * Actions executed from array or ActionSequence will print debug output for actions, and adds an action name to + * exception on failure. + * + * @param $databaseKey + * @param \Codeception\Util\ActionSequence|array|callable $actions + * @throws ModuleConfigException + * @see \Codeception\Module\Db::performInDatabase() */ - public function haveHttpHeader($name, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args())); + public function performInDatabase($databaseKey, $actions) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('performInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Deletes a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)), - * so that subsequent requests will not send it anymore. + * Inserts an SQL record into a database. This record will be erased after the test. * - * Example: * ```php * haveHttpHeader('X-Requested-With', 'Codeception'); - * $I->sendGet('test-headers.php'); - * // ... - * $I->deleteHeader('X-Requested-With'); - * $I->sendPost('some-other-page.php'); + * $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles@davis.com')); * ?> * ``` * - * @param string $name the name of the header to delete. - * @part json - * @part xml - * @see \Codeception\Module\REST::deleteHeader() + * @param string $table + * @param array $data + * + * @return integer $id + * @see \Codeception\Module\Db::haveInDatabase() */ - public function deleteHeader($name) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); + public function haveInDatabase($table, array $data) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks over the given HTTP header and (optionally) - * its value, asserting that are there + * Asserts that a row with the given column values exists. + * Provide table name and column values. * - * @param $name - * @param $value - * @part json - * @part xml - * @see \Codeception\Module\REST::seeHttpHeader() + * ```php + * seeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']); + * ``` + * Fails if no such user found. + * + * Comparison expressions can be used as well: + * + * ```php + * seeInDatabase('posts', ['num_comments >=' => '0']); + * $I->seeInDatabase('users', ['email like' => 'miles@davis.com']); + * ``` + * + * Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`. + * + * + * @param string $table + * @param array $criteria + * @see \Codeception\Module\Db::seeInDatabase() */ - public function seeHttpHeader($name, $value = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeHttpHeader', func_get_args())); + public function seeInDatabase($table, $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks over the given HTTP header and (optionally) - * its value, asserting that are there + * Asserts that a row with the given column values exists. + * Provide table name and column values. * - * @param $name - * @param $value - * @part json - * @part xml - * @see \Codeception\Module\REST::seeHttpHeader() + * ```php + * seeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']); + * ``` + * Fails if no such user found. + * + * Comparison expressions can be used as well: + * + * ```php + * seeInDatabase('posts', ['num_comments >=' => '0']); + * $I->seeInDatabase('users', ['email like' => 'miles@davis.com']); + * ``` + * + * Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`. + * + * + * @param string $table + * @param array $criteria + * @see \Codeception\Module\Db::seeInDatabase() */ - public function canSeeHttpHeader($name, $value = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeHttpHeader', func_get_args())); + public function canSeeInDatabase($table, $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks over the given HTTP header and (optionally) - * its value, asserting that are not there + * Asserts that the given number of records were found in the database. * - * @param $name - * @param $value - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeHttpHeader() + * ```php + * seeNumRecords(1, 'users', ['name' => 'davert']) + * ?> + * ``` + * + * @param int $expectedNumber Expected number + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + * @see \Codeception\Module\Db::seeNumRecords() */ - public function dontSeeHttpHeader($name, $value = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeHttpHeader', func_get_args())); + public function seeNumRecords($expectedNumber, $table, array $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumRecords', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks over the given HTTP header and (optionally) - * its value, asserting that are not there + * Asserts that the given number of records were found in the database. * - * @param $name - * @param $value - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeHttpHeader() + * ```php + * seeNumRecords(1, 'users', ['name' => 'davert']) + * ?> + * ``` + * + * @param int $expectedNumber Expected number + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + * @see \Codeception\Module\Db::seeNumRecords() */ - public function cantSeeHttpHeader($name, $value = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeHttpHeader', func_get_args())); + public function canSeeNumRecords($expectedNumber, $table, array $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumRecords', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that http response header is received only once. - * HTTP RFC2616 allows multiple response headers with the same name. - * You can check that you didn't accidentally sent the same header twice. + * Effect is opposite to ->seeInDatabase + * + * Asserts that there is no record with the given column values in a database. + * Provide table name and column values. * * ``` php * seeHttpHeaderOnce('Cache-Control'); - * ?>> + * $I->dontSeeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']); * ``` + * Fails if such user was found. * - * @param $name - * @part json - * @part xml - * @see \Codeception\Module\REST::seeHttpHeaderOnce() + * Comparison expressions can be used as well: + * + * ```php + * dontSeeInDatabase('posts', ['num_comments >=' => '0']); + * $I->dontSeeInDatabase('users', ['email like' => 'miles%']); + * ``` + * + * Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`. + * + * @param string $table + * @param array $criteria + * @see \Codeception\Module\Db::dontSeeInDatabase() */ - public function seeHttpHeaderOnce($name) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeHttpHeaderOnce', func_get_args())); + public function dontSeeInDatabase($table, $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that http response header is received only once. - * HTTP RFC2616 allows multiple response headers with the same name. - * You can check that you didn't accidentally sent the same header twice. + * Effect is opposite to ->seeInDatabase + * + * Asserts that there is no record with the given column values in a database. + * Provide table name and column values. * * ``` php * seeHttpHeaderOnce('Cache-Control'); - * ?>> + * $I->dontSeeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']); * ``` + * Fails if such user was found. * - * @param $name - * @part json - * @part xml - * @see \Codeception\Module\REST::seeHttpHeaderOnce() - */ - public function canSeeHttpHeaderOnce($name) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeHttpHeaderOnce', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. + * Comparison expressions can be used as well: * - * Returns the value of the specified header name + * ```php + * dontSeeInDatabase('posts', ['num_comments >=' => '0']); + * $I->dontSeeInDatabase('users', ['email like' => 'miles%']); + * ``` * - * @param $name - * @param Boolean $first Whether to return the first value or all header values + * Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`. * - * @return string|array The first header value if $first is true, an array of values otherwise - * @part json - * @part xml - * @see \Codeception\Module\REST::grabHttpHeader() + * @param string $table + * @param array $criteria + * @see \Codeception\Module\Db::dontSeeInDatabase() */ - public function grabHttpHeader($name, $first = true) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabHttpHeader', func_get_args())); + public function cantSeeInDatabase($table, $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Adds HTTP authentication via username/password. + * Fetches all values from the column in database. + * Provide table name, desired column and criteria. + * + * ``` php + * grabColumnFromDatabase('users', 'email', array('name' => 'RebOOter')); + * ``` + * + * @param string $table + * @param string $column + * @param array $criteria * - * @param $username - * @param $password - * @part json - * @part xml - * @see \Codeception\Module\REST::amHttpAuthenticated() + * @return array + * @see \Codeception\Module\Db::grabColumnFromDatabase() */ - public function amHttpAuthenticated($username, $password) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); + public function grabColumnFromDatabase($table, $column, array $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabColumnFromDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Adds Digest authentication via username/password. + * Fetches a single column value from a database. + * Provide table name, desired column and criteria. + * + * ``` php + * grabFromDatabase('users', 'email', array('name' => 'Davert')); + * ``` + * Comparison expressions can be used as well: + * + * ```php + * grabFromDatabase('posts', ['num_comments >=' => 100]); + * $user = $I->grabFromDatabase('users', ['email like' => 'miles%']); + * ``` + * + * Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`. * - * @param $username - * @param $password - * @part json - * @part xml - * @see \Codeception\Module\REST::amDigestAuthenticated() + * @param string $table + * @param string $column + * @param array $criteria + * + * @return mixed Returns a single column value or false + * @see \Codeception\Module\Db::grabFromDatabase() */ - public function amDigestAuthenticated($username, $password) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amDigestAuthenticated', func_get_args())); + public function grabFromDatabase($table, $column, $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Adds Bearer authentication via access token. + * Returns the number of rows in a database + * + * @param string $table Table name + * @param array $criteria Search criteria [Optional] * - * @param $accessToken - * @part json - * @part xml - * @see \Codeception\Module\REST::amBearerAuthenticated() + * @return int + * @see \Codeception\Module\Db::grabNumRecords() */ - public function amBearerAuthenticated($accessToken) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amBearerAuthenticated', func_get_args())); + public function grabNumRecords($table, array $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabNumRecords', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Adds NTLM authentication via username/password. - * Requires client to be Guzzle >=6.3.0 - * Out of scope for functional modules. + * Update an SQL record into a database. * - * Example: * ```php * amNTLMAuthenticated('jon_snow', 'targaryen'); + * $I->updateInDatabase('users', array('isAdmin' => true), array('email' => 'miles@davis.com')); * ?> * ``` * - * @param $username - * @param $password - * @throws ModuleException - * @part json - * @part xml - * @see \Codeception\Module\REST::amNTLMAuthenticated() + * @param string $table + * @param array $data + * @param array $criteria + * @see \Codeception\Module\Db::updateInDatabase() */ - public function amNTLMAuthenticated($username, $password) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amNTLMAuthenticated', func_get_args())); + public function updateInDatabase($table, array $data, array $criteria = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('updateInDatabase', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends a POST request to given uri. Parameters and files can be provided separately. + * Delete All Emails + * + * Accessible from tests, deletes all emails + * @see \Codeception\Module\MailHog::deleteAllEmails() + */ + public function deleteAllEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteAllEmails', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * Example: - * ```php - * sendPost('/message', ['subject' => 'Read this!', 'to' => 'johndoe@example.com']); - * //simple upload method - * $I->sendPost('/message/24', ['inline' => 0], ['attachmentFile' => codecept_data_dir('sample_file.pdf')]); - * //uploading a file with a custom name and mime-type. This is also useful to simulate upload errors. - * $I->sendPost('/message/24', ['inline' => 0], [ - * 'attachmentFile' => [ - * 'name' => 'document.pdf', - * 'type' => 'application/pdf', - * 'error' => UPLOAD_ERR_OK, - * 'size' => filesize(codecept_data_dir('sample_file.pdf')), - * 'tmp_name' => codecept_data_dir('sample_file.pdf') - * ] - * ]); - * // If your field names contain square brackets (e.g. ``), - * // PHP parses them into an array. In this case you need to pass the fields like this: - * $I->sendPost('/add-task', ['form' => [ - * 'task' => 'lorem ipsum', - * 'category' => 'miscellaneous', - * ]]); - * ``` + * Fetch Emails + * + * Accessible from tests, fetches all emails + * @see \Codeception\Module\MailHog::fetchEmails() + */ + public function fetchEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('fetchEmails', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Access Inbox For * * - * @param $url - * @param array|string|\JsonSerializable $params - * @param array $files A list of filenames or "mocks" of $_FILES (each entry being an array with the following - * keys: name, type, error, size, tmp_name (pointing to the real file path). Each key works - * as the "name" attribute of a file input field. + * Filters emails to only keep those that are received by the provided address * - * @see http://php.net/manual/en/features.file-upload.post-method.php - * @see codecept_data_dir() - * @part json - * @part xml - * @see \Codeception\Module\REST::sendPost() + * @param string $address Recipient address' inbox + * @see \Codeception\Module\MailHog::accessInboxFor() */ - public function sendPost($url, $params = [], $files = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPost', func_get_args())); + public function accessInboxFor($address) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('accessInboxFor', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends a HEAD request to given uri. + * Access Inbox For To * - * @param $url - * @param array $params - * @part json - * @part xml - * @see \Codeception\Module\REST::sendHead() + * Filters emails to only keep those that are received by the provided address + * + * @param string $address Recipient address' inbox + * @see \Codeception\Module\MailHog::accessInboxForTo() */ - public function sendHead($url, $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendHead', func_get_args())); + public function accessInboxForTo($address) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('accessInboxForTo', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends an OPTIONS request to given uri. + * Access Inbox For CC * - * @param $url - * @param array $params - * @part json - * @part xml - * @see \Codeception\Module\REST::sendOptions() + * Filters emails to only keep those that are received by the provided address + * + * @param string $address Recipient address' inbox + * @see \Codeception\Module\MailHog::accessInboxForCc() */ - public function sendOptions($url, $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendOptions', func_get_args())); + public function accessInboxForCc($address) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('accessInboxForCc', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends a GET request to given uri. + * Access Inbox For BCC * - * @param $url - * @param array $params - * @part json - * @part xml - * @see \Codeception\Module\REST::sendGet() + * Filters emails to only keep those that are received by the provided address + * + * @param string $address Recipient address' inbox + * @see \Codeception\Module\MailHog::accessInboxForBcc() */ - public function sendGet($url, $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendGet', func_get_args())); + public function accessInboxForBcc($address) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('accessInboxForBcc', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends PUT request to given uri. + * Open Next Unread Email + * + * Pops the most recent unread email and assigns it as the email to conduct tests on + * @see \Codeception\Module\MailHog::openNextUnreadEmail() + */ + public function openNextUnreadEmail() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('openNextUnreadEmail', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $url - * @param array|string|\JsonSerializable $params - * @param array $files - * @part json - * @part xml - * @see \Codeception\Module\REST::sendPut() + * Get Email To + * + * Returns the string containing the persons included in the To field + * + * @param mixed $emailA Email + * @param mixed $emailB Email + * @return int Which email should go first + * @see \Codeception\Module\MailHog::sortEmailsByCreationDatePredicate() */ - public function sendPut($url, $params = [], $files = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPut', func_get_args())); + public function sortEmailsByCreationDatePredicate($emailA, $emailB) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('sortEmailsByCreationDatePredicate', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends PATCH request to given uri. + * Have Emails + * + * Checks if there are any emails in the inbox + * @see \Codeception\Module\MailHog::haveEmails() + */ + public function haveEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveEmails', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $url - * @param array|string|\JsonSerializable $params - * @param array $files - * @part json - * @part xml - * @see \Codeception\Module\REST::sendPatch() + * Have Number Of Emails + * + * Checks that the amount of emails in the inbox is exactly $expected + * @params int $expected Number of expected emails + * @see \Codeception\Module\MailHog::haveNumberOfEmails() */ - public function sendPatch($url, $params = [], $files = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPatch', func_get_args())); + public function haveNumberOfEmails($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveNumberOfEmails', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends DELETE request to given uri. + * Dont Have Emails + * + * Checks that there are no emails in the inbox + * @see \Codeception\Module\MailHog::dontHaveEmails() + */ + public function dontHaveEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontHaveEmails', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $url - * @param array $params - * @param array $files - * @part json - * @part xml - * @see \Codeception\Module\REST::sendDelete() + * Have Unread Emails + * + * Checks that there is at least one unread email + * + * @see \Codeception\Module\MailHog::haveUnreadEmails() */ - public function sendDelete($url, $params = [], $files = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendDelete', func_get_args())); + public function haveUnreadEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveUnreadEmails', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends a HTTP request. + * Have Number Of Unread Emails + * + * Checks that the amount of emails in the unread inbox is exactly $expected + * @params int $expected Number of expected emails + * @see \Codeception\Module\MailHog::haveNumberOfUnreadEmails() + */ + public function haveNumberOfUnreadEmails($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveNumberOfUnreadEmails', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $method - * @param $url - * @param array|string|\JsonSerializable $params - * @param array $files - * @part json - * @part xml - * @see \Codeception\Module\REST::send() + * Dont Have Unread Emails + * + * Checks that there are no unread emails in the inbox + * @see \Codeception\Module\MailHog::dontHaveUnreadEmails() */ - public function send($method, $url, $params = [], $files = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('send', func_get_args())); + public function dontHaveUnreadEmails() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontHaveUnreadEmails', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends LINK request to given uri. + * See In Opened Email Body + * + * Validates that $expected can be found in the opened email body + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailBody() + */ + public function seeInOpenedEmailBody($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailBody', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $url - * @param array $linkEntries (entry is array with keys "uri" and "link-param") + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Opened Email Body + * + * Validates that $expected can be found in the opened email body + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailBody() + */ + public function canSeeInOpenedEmailBody($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailBody', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @link http://tools.ietf.org/html/rfc2068#section-19.6.2.4 + * See In Opened Email Subject + * + * Validates that $expected can be found in the opened email subject + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailSubject() + */ + public function seeInOpenedEmailSubject($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailSubject', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @author samva.ua@gmail.com - * @part json - * @part xml - * @see \Codeception\Module\REST::sendLink() + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Opened Email Subject + * + * Validates that $expected can be found in the opened email subject + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailSubject() */ - public function sendLink($url, array $linkEntries) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendLink', func_get_args())); + public function canSeeInOpenedEmailSubject($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailSubject', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Sends UNLINK request to given uri. + * Dont See In Opened Email Body + * + * Checks that $expected cannot be found in the opened email body + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailBody() + */ + public function dontSeeInOpenedEmailBody($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailBody', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $url - * @param array $linkEntries (entry is array with keys "uri" and "link-param") - * @link http://tools.ietf.org/html/rfc2068#section-19.6.2.4 - * @author samva.ua@gmail.com - * @part json - * @part xml - * @see \Codeception\Module\REST::sendUnlink() + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Opened Email Body + * + * Checks that $expected cannot be found in the opened email body + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailBody() */ - public function sendUnlink($url, array $linkEntries) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendUnlink', func_get_args())); + public function cantSeeInOpenedEmailBody($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailBody', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether last response was valid JSON. - * This is done with json_last_error function. - * - * @part json - * @see \Codeception\Module\REST::seeResponseIsJson() + * Dont See In Opened Email Subject + * + * Checks that $expected cannot be found in the opened email subject + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailSubject() */ - public function seeResponseIsJson() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseIsJson', func_get_args())); + public function dontSeeInOpenedEmailSubject($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailSubject', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether last response was valid JSON. - * This is done with json_last_error function. - * - * @part json - * @see \Codeception\Module\REST::seeResponseIsJson() + * Dont See In Opened Email Subject + * + * Checks that $expected cannot be found in the opened email subject + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailSubject() */ - public function canSeeResponseIsJson() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseIsJson', func_get_args())); + public function cantSeeInOpenedEmailSubject($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailSubject', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether the last response contains text. - * - * @param $text - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseContains() + * See In Email Body + * + * Checks that the body of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailBody() */ - public function seeResponseContains($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseContains', func_get_args())); + public function seeInEmailBody($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailBody', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether the last response contains text. - * - * @param $text - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseContains() + * See In Email Body + * + * Checks that the body of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailBody() */ - public function canSeeResponseContains($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseContains', func_get_args())); + public function canSeeInEmailBody($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailBody', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether last response do not contain text. + * Dont See In Email Body + * + * Checks that the body of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailBody() + */ + public function dontSeeInEmailBody($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailBody', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Email Body + * + * Checks that the body of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailBody() + */ + public function cantSeeInEmailBody($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailBody', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $text - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeResponseContains() + * See In Email Subject + * + * Checks that the subject of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailSubject() */ - public function dontSeeResponseContains($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseContains', func_get_args())); + public function seeInEmailSubject($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailSubject', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether last response do not contain text. + * See In Email Subject + * + * Checks that the subject of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailSubject() + */ + public function canSeeInEmailSubject($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailSubject', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param $text - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeResponseContains() + * Dont See In Email Subject + * + * Checks that the subject of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailSubject() */ - public function cantSeeResponseContains($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseContains', func_get_args())); + public function dontSeeInEmailSubject($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailSubject', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Email Subject + * + * Checks that the subject of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailSubject() + */ + public function cantSeeInEmailSubject($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailSubject', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether the last JSON response contains provided array. - * The response is converted to array with json_decode($response, true) - * Thus, JSON is represented by associative array. - * This method matches that response array contains provided array. + * See In Opened Email Sender + * + * Checks if the sender of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailSender() + */ + public function seeInOpenedEmailSender($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailSender', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * Examples: + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Opened Email Sender + * + * Checks if the sender of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailSender() + */ + public function canSeeInOpenedEmailSender($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailSender', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * ``` php - * seeResponseContainsJson(array('name' => 'john')); + * Dont See In Opened Email Sender + * + * Checks if the sender of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailSender() + */ + public function dontSeeInOpenedEmailSender($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailSender', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * // response {user: john, profile: { email: john@gmail.com }} - * $I->seeResponseContainsJson(array('email' => 'john@gmail.com')); + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Opened Email Sender + * + * Checks if the sender of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailSender() + */ + public function cantSeeInOpenedEmailSender($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailSender', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * ?> - * ``` + * See In Email Sender + * + * Checks if the sender of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailSender() + */ + public function seeInEmailSender($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailSender', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * This method recursively checks if one array can be found inside of another. + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Email Sender + * + * Checks if the sender of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailSender() + */ + public function canSeeInEmailSender($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailSender', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param array $json - * @part json - * @see \Codeception\Module\REST::seeResponseContainsJson() + * Dont See In Email Sender + * + * Checks if the sender of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailSender() */ - public function seeResponseContainsJson($json = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseContainsJson', func_get_args())); + public function dontSeeInEmailSender($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailSender', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether the last JSON response contains provided array. - * The response is converted to array with json_decode($response, true) - * Thus, JSON is represented by associative array. - * This method matches that response array contains provided array. + * Dont See In Email Sender + * + * Checks if the sender of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailSender() + */ + public function cantSeeInEmailSender($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailSender', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * Examples: + * See In Opened Email Reply To + * + * Checks if the ReplyTo of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailReplyTo() + */ + public function seeInOpenedEmailReplyTo($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailReplyTo', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * ``` php - * seeResponseContainsJson(array('name' => 'john')); + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Opened Email Reply To + * + * Checks if the ReplyTo of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailReplyTo() + */ + public function canSeeInOpenedEmailReplyTo($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailReplyTo', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * // response {user: john, profile: { email: john@gmail.com }} - * $I->seeResponseContainsJson(array('email' => 'john@gmail.com')); + * Dont See In Opened Email Reply To + * + * Checks if the ReplyTo of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailReplyTo() + */ + public function dontSeeInOpenedEmailReplyTo($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailReplyTo', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * ?> - * ``` + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Opened Email Reply To + * + * Checks if the ReplyTo of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailReplyTo() + */ + public function cantSeeInOpenedEmailReplyTo($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailReplyTo', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * This method recursively checks if one array can be found inside of another. + * See In Email Reply To + * + * Checks if the ReplyTo of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailReplyTo() + */ + public function seeInEmailReplyTo($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailReplyTo', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param array $json - * @part json - * @see \Codeception\Module\REST::seeResponseContainsJson() + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Email Reply To + * + * Checks if the ReplyTo of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailReplyTo() */ - public function canSeeResponseContainsJson($json = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseContainsJson', func_get_args())); + public function canSeeInEmailReplyTo($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailReplyTo', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether last response matches the supplied json schema (https://json-schema.org/) - * Supply schema as json string. - * - * Examples: - * - * ``` php - * seeResponseIsValidOnJsonSchemaString('{"type": "object"}'); - * - * // response {"name": "john", "age": 20} - * $schema = [ - * "properties" => [ - * "age" => [ - * "type" => "integer", - * "minimum" => 18 - * ] - * ] - * ]; - * $I->seeResponseIsValidOnJsonSchemaString(json_encode($schema)); - * - * ?> - * ``` - * - * @param string $schema - * @part json - * @see \Codeception\Module\REST::seeResponseIsValidOnJsonSchemaString() + * Dont See In Email Reply To + * + * Checks if the ReplyTo of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailReplyTo() */ - public function seeResponseIsValidOnJsonSchemaString($schema) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseIsValidOnJsonSchemaString', func_get_args())); + public function dontSeeInEmailReplyTo($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailReplyTo', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether last response matches the supplied json schema (https://json-schema.org/) - * Supply schema as json string. - * - * Examples: - * - * ``` php - * seeResponseIsValidOnJsonSchemaString('{"type": "object"}'); - * - * // response {"name": "john", "age": 20} - * $schema = [ - * "properties" => [ - * "age" => [ - * "type" => "integer", - * "minimum" => 18 - * ] - * ] - * ]; - * $I->seeResponseIsValidOnJsonSchemaString(json_encode($schema)); - * - * ?> - * ``` - * - * @param string $schema - * @part json - * @see \Codeception\Module\REST::seeResponseIsValidOnJsonSchemaString() + * Dont See In Email Reply To + * + * Checks if the ReplyTo of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailReplyTo() */ - public function canSeeResponseIsValidOnJsonSchemaString($schema) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseIsValidOnJsonSchemaString', func_get_args())); + public function cantSeeInEmailReplyTo($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailReplyTo', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks whether last response matches the supplied json schema (https://json-schema.org/) - * Supply schema as relative file path in your project directory or an absolute path - * - * @see codecept_absolute_path() - * - * @param string $schemaFilename - * @part json - * @see \Codeception\Module\REST::seeResponseIsValidOnJsonSchema() + * See In Opened Email Recipients + * + * Checks that the recipients of the opened email contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailRecipients() */ - public function seeResponseIsValidOnJsonSchema($schemaFilename) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseIsValidOnJsonSchema', func_get_args())); + public function seeInOpenedEmailRecipients($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks whether last response matches the supplied json schema (https://json-schema.org/) - * Supply schema as relative file path in your project directory or an absolute path - * - * @see codecept_absolute_path() - * - * @param string $schemaFilename - * @part json - * @see \Codeception\Module\REST::seeResponseIsValidOnJsonSchema() + * See In Opened Email Recipients + * + * Checks that the recipients of the opened email contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailRecipients() */ - public function canSeeResponseIsValidOnJsonSchema($schemaFilename) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseIsValidOnJsonSchema', func_get_args())); + public function canSeeInOpenedEmailRecipients($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Returns current response so that it can be used in next scenario steps. - * - * Example: - * - * ``` php - * grabResponse(); - * $I->sendPut('/user', array('id' => $user_id, 'name' => 'davert')); - * ?> - * ``` + * Dont See In Opened Email Recipients + * + * Checks that the recipients of the opened email do not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailRecipients() + */ + public function dontSeeInOpenedEmailRecipients($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailRecipients', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @return string - * @part json - * @part xml - * @see \Codeception\Module\REST::grabResponse() + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Opened Email Recipients + * + * Checks that the recipients of the opened email do not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailRecipients() */ - public function grabResponse() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabResponse', func_get_args())); + public function cantSeeInOpenedEmailRecipients($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * See [#jsonpath](#jsonpath) for general info on JSONPath. - * Even for a single value an array is returned. - * Example: - * - * ``` php - * grabDataFromResponseByJsonPath('$..users[0].id'); - * $I->sendPut('/user', array('id' => $firstUserId[0], 'name' => 'davert')); - * ?> - * ``` + * See In Email Recipients + * + * Checks that the recipients of $email contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailRecipients() + */ + public function seeInEmailRecipients($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailRecipients', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @param string $jsonPath - * @return array Array of matching items - * @throws \Exception - * @part json - * @see \Codeception\Module\REST::grabDataFromResponseByJsonPath() + * [!] Conditional Assertion: Test won't be stopped on fail + * See In Email Recipients + * + * Checks that the recipients of $email contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailRecipients() */ - public function grabDataFromResponseByJsonPath($jsonPath) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabDataFromResponseByJsonPath', func_get_args())); + public function canSeeInEmailRecipients($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks if json structure in response matches the xpath provided. - * JSON is not supposed to be checked against XPath, yet it can be converted to xml and used with XPath. - * This assertion allows you to check the structure of response json. - * * - * ```json - * { "store": { - * "book": [ - * { "category": "reference", - * "author": "Nigel Rees", - * "title": "Sayings of the Century", - * "price": 8.95 - * }, - * { "category": "fiction", - * "author": "Evelyn Waugh", - * "title": "Sword of Honour", - * "price": 12.99 - * } - * ], - * "bicycle": { - * "color": "red", - * "price": 19.95 - * } - * } - * } - * ``` - * - * ```php - * seeResponseJsonMatchesXpath('//store/book/author'); - * // first book in store has author - * $I->seeResponseJsonMatchesXpath('//store/book[1]/author'); - * // at least one item in store has price - * $I->seeResponseJsonMatchesXpath('/store//price'); - * ?> - * ``` - * @param string $xpath - * @part json - * @see \Codeception\Module\REST::seeResponseJsonMatchesXpath() + * Dont See In Email Recipients + * + * Checks that the recipients of $email do not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailRecipients() */ - public function seeResponseJsonMatchesXpath($xpath) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseJsonMatchesXpath', func_get_args())); + public function dontSeeInEmailRecipients($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if json structure in response matches the xpath provided. - * JSON is not supposed to be checked against XPath, yet it can be converted to xml and used with XPath. - * This assertion allows you to check the structure of response json. - * * - * ```json - * { "store": { - * "book": [ - * { "category": "reference", - * "author": "Nigel Rees", - * "title": "Sayings of the Century", - * "price": 8.95 - * }, - * { "category": "fiction", - * "author": "Evelyn Waugh", - * "title": "Sword of Honour", - * "price": 12.99 - * } - * ], - * "bicycle": { - * "color": "red", - * "price": 19.95 - * } - * } - * } - * ``` - * - * ```php - * seeResponseJsonMatchesXpath('//store/book/author'); - * // first book in store has author - * $I->seeResponseJsonMatchesXpath('//store/book[1]/author'); - * // at least one item in store has price - * $I->seeResponseJsonMatchesXpath('/store//price'); - * ?> - * ``` - * @param string $xpath - * @part json - * @see \Codeception\Module\REST::seeResponseJsonMatchesXpath() + * Dont See In Email Recipients + * + * Checks that the recipients of $email do not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailRecipients() */ - public function canSeeResponseJsonMatchesXpath($xpath) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseJsonMatchesXpath', func_get_args())); + public function cantSeeInEmailRecipients($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailRecipients', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Opposite to seeResponseJsonMatchesXpath - * - * @param string $xpath - * @part json - * @see \Codeception\Module\REST::dontSeeResponseJsonMatchesXpath() + * See In Opened Email To Field + * + * Checks that the To field of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailToField() */ - public function dontSeeResponseJsonMatchesXpath($xpath) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseJsonMatchesXpath', func_get_args())); + public function seeInOpenedEmailToField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Opposite to seeResponseJsonMatchesXpath - * - * @param string $xpath - * @part json - * @see \Codeception\Module\REST::dontSeeResponseJsonMatchesXpath() + * See In Opened Email To Field + * + * Checks that the To field of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailToField() */ - public function cantSeeResponseJsonMatchesXpath($xpath) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseJsonMatchesXpath', func_get_args())); + public function canSeeInOpenedEmailToField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * See [#jsonpath](#jsonpath) for general info on JSONPath. - * Checks if JSON structure in response matches JSONPath. - * - * ```json - * { "store": { - * "book": [ - * { "category": "reference", - * "author": "Nigel Rees", - * "title": "Sayings of the Century", - * "price": 8.95 - * }, - * { "category": "fiction", - * "author": "Evelyn Waugh", - * "title": "Sword of Honour", - * "price": 12.99 - * } - * ], - * "bicycle": { - * "color": "red", - * "price": 19.95 - * } - * } - * } - * ``` - * - * ```php - * seeResponseJsonMatchesJsonPath('$.store.book[*].author'); - * // first book in store has author - * $I->seeResponseJsonMatchesJsonPath('$.store.book[0].author'); - * // at least one item in store has price - * $I->seeResponseJsonMatchesJsonPath('$.store..price'); - * ?> - * ``` - * - * @param string $jsonPath - * @part json - * @see \Codeception\Module\REST::seeResponseJsonMatchesJsonPath() + * Dont See In Opened Email To Field + * + * Checks that the To field of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailToField() */ - public function seeResponseJsonMatchesJsonPath($jsonPath) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseJsonMatchesJsonPath', func_get_args())); + public function dontSeeInOpenedEmailToField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * See [#jsonpath](#jsonpath) for general info on JSONPath. - * Checks if JSON structure in response matches JSONPath. - * - * ```json - * { "store": { - * "book": [ - * { "category": "reference", - * "author": "Nigel Rees", - * "title": "Sayings of the Century", - * "price": 8.95 - * }, - * { "category": "fiction", - * "author": "Evelyn Waugh", - * "title": "Sword of Honour", - * "price": 12.99 - * } - * ], - * "bicycle": { - * "color": "red", - * "price": 19.95 - * } - * } - * } - * ``` - * - * ```php - * seeResponseJsonMatchesJsonPath('$.store.book[*].author'); - * // first book in store has author - * $I->seeResponseJsonMatchesJsonPath('$.store.book[0].author'); - * // at least one item in store has price - * $I->seeResponseJsonMatchesJsonPath('$.store..price'); - * ?> - * ``` - * - * @param string $jsonPath - * @part json - * @see \Codeception\Module\REST::seeResponseJsonMatchesJsonPath() + * Dont See In Opened Email To Field + * + * Checks that the To field of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailToField() */ - public function canSeeResponseJsonMatchesJsonPath($jsonPath) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseJsonMatchesJsonPath', func_get_args())); + public function cantSeeInOpenedEmailToField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * See [#jsonpath](#jsonpath) for general info on JSONPath. - * Opposite to [`seeResponseJsonMatchesJsonPath()`](#seeResponseJsonMatchesJsonPath) - * - * @param string $jsonPath - * @part json - * @see \Codeception\Module\REST::dontSeeResponseJsonMatchesJsonPath() + * See In Email To Field + * + * Checks that the To field of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailToField() */ - public function dontSeeResponseJsonMatchesJsonPath($jsonPath) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseJsonMatchesJsonPath', func_get_args())); + public function seeInEmailToField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * See [#jsonpath](#jsonpath) for general info on JSONPath. - * Opposite to [`seeResponseJsonMatchesJsonPath()`](#seeResponseJsonMatchesJsonPath) - * - * @param string $jsonPath - * @part json - * @see \Codeception\Module\REST::dontSeeResponseJsonMatchesJsonPath() + * See In Email To Field + * + * Checks that the To field of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailToField() */ - public function cantSeeResponseJsonMatchesJsonPath($jsonPath) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseJsonMatchesJsonPath', func_get_args())); + public function canSeeInEmailToField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Opposite to seeResponseContainsJson - * - * @part json - * @param array $json - * @see \Codeception\Module\REST::dontSeeResponseContainsJson() + * Dont See In Email To Field + * + * Checks that the To field of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailToField() */ - public function dontSeeResponseContainsJson($json = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseContainsJson', func_get_args())); + public function dontSeeInEmailToField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Opposite to seeResponseContainsJson - * - * @part json - * @param array $json - * @see \Codeception\Module\REST::dontSeeResponseContainsJson() + * Dont See In Email To Field + * + * Checks that the To field of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailToField() */ - public function cantSeeResponseContainsJson($json = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseContainsJson', func_get_args())); + public function cantSeeInEmailToField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailToField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that JSON matches provided types. - * In case you don't know the actual values of JSON data returned you can match them by type. - * It starts the check with a root element. If JSON data is an array it will check all elements of it. - * You can specify the path in the json which should be checked with JsonPath - * - * Basic example: - * - * ```php - * seeResponseMatchesJsonType([ - * 'user_id' => 'integer', - * 'name' => 'string|null', - * 'is_active' => 'boolean' - * ]); - * - * // narrow down matching with JsonPath: - * // {"users": [{ "name": "davert"}, {"id": 1}]} - * $I->seeResponseMatchesJsonType(['name' => 'string'], '$.users[0]'); - * ?> - * ``` - * - * You can check if the record contains fields with the data types you expect. - * The list of possible data types: - * - * * string - * * integer - * * float - * * array (json object is array as well) - * * boolean - * * null - * - * You can also use nested data type structures, and define multiple types for the same field: - * - * ```php - * seeResponseMatchesJsonType([ - * 'user_id' => 'integer|string', // multiple types - * 'company' => ['name' => 'string'] - * ]); - * ?> - * ``` - * - * You can also apply filters to check values. Filter can be applied with a `:` char after the type declaration, - * or after another filter if you need more than one. - * - * Here is the list of possible filters: - * - * * `integer:>{val}` - checks that integer is greater than {val} (works with float and string types too). - * * `integer:<{val}` - checks that integer is lower than {val} (works with float and string types too). - * * `string:url` - checks that value is valid url. - * * `string:date` - checks that value is date in JavaScript format: https://weblog.west-wind.com/posts/2014/Jan/06/JavaScript-JSON-Date-Parsing-and-real-Dates - * * `string:email` - checks that value is a valid email according to http://emailregex.com/ - * * `string:regex({val})` - checks that string matches a regex provided with {val} - * - * This is how filters can be used: - * - * ```php - * 'davert@codeception.com'} - * $I->seeResponseMatchesJsonType([ - * 'user_id' => 'string:>0:<1000', // multiple filters can be used - * 'email' => 'string:regex(~\@~)' // we just check that @ char is included - * ]); - * - * // {'user_id': '1'} - * $I->seeResponseMatchesJsonType([ - * 'user_id' => 'string:>0', // works with strings as well - * ]); - * ?> - * ``` - * - * You can also add custom filters by using `{@link JsonType::addCustomFilter()}`. - * See [JsonType reference](http://codeception.com/docs/reference/JsonType). - * - * @part json - * @param array $jsonType - * @param string $jsonPath - * @see JsonType - * @see \Codeception\Module\REST::seeResponseMatchesJsonType() + * See In Opened Email CC Field + * + * Checks that the CC field of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailCCField() */ - public function seeResponseMatchesJsonType(array $jsonType, $jsonPath = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseMatchesJsonType', func_get_args())); + public function seeInOpenedEmailCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that JSON matches provided types. - * In case you don't know the actual values of JSON data returned you can match them by type. - * It starts the check with a root element. If JSON data is an array it will check all elements of it. - * You can specify the path in the json which should be checked with JsonPath - * - * Basic example: - * - * ```php - * seeResponseMatchesJsonType([ - * 'user_id' => 'integer', - * 'name' => 'string|null', - * 'is_active' => 'boolean' - * ]); - * - * // narrow down matching with JsonPath: - * // {"users": [{ "name": "davert"}, {"id": 1}]} - * $I->seeResponseMatchesJsonType(['name' => 'string'], '$.users[0]'); - * ?> - * ``` - * - * You can check if the record contains fields with the data types you expect. - * The list of possible data types: - * - * * string - * * integer - * * float - * * array (json object is array as well) - * * boolean - * * null - * - * You can also use nested data type structures, and define multiple types for the same field: - * - * ```php - * seeResponseMatchesJsonType([ - * 'user_id' => 'integer|string', // multiple types - * 'company' => ['name' => 'string'] - * ]); - * ?> - * ``` - * - * You can also apply filters to check values. Filter can be applied with a `:` char after the type declaration, - * or after another filter if you need more than one. - * - * Here is the list of possible filters: - * - * * `integer:>{val}` - checks that integer is greater than {val} (works with float and string types too). - * * `integer:<{val}` - checks that integer is lower than {val} (works with float and string types too). - * * `string:url` - checks that value is valid url. - * * `string:date` - checks that value is date in JavaScript format: https://weblog.west-wind.com/posts/2014/Jan/06/JavaScript-JSON-Date-Parsing-and-real-Dates - * * `string:email` - checks that value is a valid email according to http://emailregex.com/ - * * `string:regex({val})` - checks that string matches a regex provided with {val} - * - * This is how filters can be used: - * - * ```php - * 'davert@codeception.com'} - * $I->seeResponseMatchesJsonType([ - * 'user_id' => 'string:>0:<1000', // multiple filters can be used - * 'email' => 'string:regex(~\@~)' // we just check that @ char is included - * ]); - * - * // {'user_id': '1'} - * $I->seeResponseMatchesJsonType([ - * 'user_id' => 'string:>0', // works with strings as well - * ]); - * ?> - * ``` - * - * You can also add custom filters by using `{@link JsonType::addCustomFilter()}`. - * See [JsonType reference](http://codeception.com/docs/reference/JsonType). - * - * @part json - * @param array $jsonType - * @param string $jsonPath - * @see JsonType - * @see \Codeception\Module\REST::seeResponseMatchesJsonType() + * See In Opened Email CC Field + * + * Checks that the CC field of the opened email contains $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailCCField() */ - public function canSeeResponseMatchesJsonType(array $jsonType, $jsonPath = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseMatchesJsonType', func_get_args())); + public function canSeeInOpenedEmailCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Opposite to `seeResponseMatchesJsonType`. - * - * @part json - * @param array $jsonType JsonType structure - * @param string $jsonPath - * @see seeResponseMatchesJsonType - * @see \Codeception\Module\REST::dontSeeResponseMatchesJsonType() + * Dont See In Opened Email CC Field + * + * Checks that the CC field of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailCCField() */ - public function dontSeeResponseMatchesJsonType(array $jsonType, $jsonPath = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseMatchesJsonType', func_get_args())); + public function dontSeeInOpenedEmailCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Opposite to `seeResponseMatchesJsonType`. - * - * @part json - * @param array $jsonType JsonType structure - * @param string $jsonPath - * @see seeResponseMatchesJsonType - * @see \Codeception\Module\REST::dontSeeResponseMatchesJsonType() + * Dont See In Opened Email CC Field + * + * Checks that the CC field of the opened email does not contain $expected + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailCCField() */ - public function cantSeeResponseMatchesJsonType(array $jsonType, $jsonPath = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseMatchesJsonType', func_get_args())); + public function cantSeeInOpenedEmailCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks if response is exactly the same as provided. - * - * @part json - * @part xml - * @param $response - * @see \Codeception\Module\REST::seeResponseEquals() + * See In Email CC Field + * + * Checks that the CC field of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailCCField() */ - public function seeResponseEquals($expected) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseEquals', func_get_args())); + public function seeInEmailCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if response is exactly the same as provided. - * - * @part json - * @part xml - * @param $response - * @see \Codeception\Module\REST::seeResponseEquals() + * See In Email CC Field + * + * Checks that the CC field of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailCCField() */ - public function canSeeResponseEquals($expected) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseEquals', func_get_args())); + public function canSeeInEmailCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks response code equals to provided value. - * - * ```php - * seeResponseCodeIs(200); - * - * // preferred to use \Codeception\Util\HttpCode - * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @part json - * @part xml - * @param $code - * @see \Codeception\Module\REST::seeResponseCodeIs() + * Dont See In Email CC Field + * + * Checks that the CC field of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailCCField() */ - public function seeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); + public function dontSeeInEmailCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks response code equals to provided value. - * - * ```php - * seeResponseCodeIs(200); - * - * // preferred to use \Codeception\Util\HttpCode - * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @part json - * @part xml - * @param $code - * @see \Codeception\Module\REST::seeResponseCodeIs() + * Dont See In Email CC Field + * + * Checks that the CC field of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailCCField() */ - public function canSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); + public function cantSeeInEmailCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that response code is not equal to provided value. - * - * ```php - * dontSeeResponseCodeIs(200); - * - * // preferred to use \Codeception\Util\HttpCode - * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @part json - * @part xml - * @param $code - * @see \Codeception\Module\REST::dontSeeResponseCodeIs() + * See In Opened Email BCC Field + * + * Checks that the BCC field of the opened email contains $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailBCCField() */ - public function dontSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseCodeIs', func_get_args())); + public function seeInOpenedEmailBCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that response code is not equal to provided value. - * - * ```php - * dontSeeResponseCodeIs(200); - * - * // preferred to use \Codeception\Util\HttpCode - * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @part json - * @part xml - * @param $code - * @see \Codeception\Module\REST::dontSeeResponseCodeIs() + * See In Opened Email BCC Field + * + * Checks that the BCC field of the opened email contains $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInOpenedEmailBCCField() */ - public function cantSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseCodeIs', func_get_args())); + public function canSeeInOpenedEmailBCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that the response code is 2xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsSuccessful() + * Dont See In Opened Email BCC Field + * + * Checks that the BCC field of the opened email does not contain $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailBCCField() */ - public function seeResponseCodeIsSuccessful() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsSuccessful', func_get_args())); + public function dontSeeInOpenedEmailBCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code is 2xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsSuccessful() + * Dont See In Opened Email BCC Field + * + * Checks that the BCC field of the opened email does not contain $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailBCCField() */ - public function canSeeResponseCodeIsSuccessful() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsSuccessful', func_get_args())); + public function cantSeeInOpenedEmailBCCField($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that the response code 3xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsRedirection() + * See In Email BCC Field + * + * Checks that the BCC field of $email contains $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailBCCField() */ - public function seeResponseCodeIsRedirection() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsRedirection', func_get_args())); + public function seeInEmailBCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code 3xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsRedirection() + * See In Email BCC Field + * + * Checks that the BCC field of $email contains $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::seeInEmailBCCField() */ - public function canSeeResponseCodeIsRedirection() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsRedirection', func_get_args())); + public function canSeeInEmailBCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that the response code is 4xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsClientError() + * Dont See In Email BCC Field + * + * Checks that the BCC field of $email does not contain $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailBCCField() */ - public function seeResponseCodeIsClientError() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsClientError', func_get_args())); + public function dontSeeInEmailBCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code is 4xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsClientError() + * Dont See In Email BCC Field + * + * Checks that the BCC field of $email does not contain $expected + * + * Warning: it is possible for an email to have its BCC field empty, it doesn't mean that another instance of the same email doesn't exist. + * + * @param mixed $email a JSON encoded email + * @param string $expected Text + * @see \Codeception\Module\MailHog::dontSeeInEmailBCCField() */ - public function canSeeResponseCodeIsClientError() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsClientError', func_get_args())); + public function cantSeeInEmailBCCField($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailBCCField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks that the response code is 5xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsServerError() + * See In Opened Email Priority + * + * Checks that the priority of the opened email contains $expected + * + * @param string $expected priority + * @see \Codeception\Module\MailHog::seeInOpenedEmailPriority() */ - public function seeResponseCodeIsServerError() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsServerError', func_get_args())); + public function seeInOpenedEmailPriority($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInOpenedEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code is 5xx - * - * @part json - * @part xml - * @see \Codeception\Module\REST::seeResponseCodeIsServerError() + * See In Opened Email Priority + * + * Checks that the priority of the opened email contains $expected + * + * @param string $expected priority + * @see \Codeception\Module\MailHog::seeInOpenedEmailPriority() */ - public function canSeeResponseCodeIsServerError() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsServerError', func_get_args())); + public function canSeeInOpenedEmailPriority($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInOpenedEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks if the hash of a binary response is exactly the same as provided. - * Parameter can be passed as any hash string supported by hash(), with an - * optional second parameter to specify the hash type, which defaults to md5. - * - * Example: Using md5 hash key - * - * ```php - * seeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded"); - * ?> - * ``` - * - * Example: Using md5 for a file contents - * - * ```php - * seeBinaryResponseEquals(md5($fileData)); - * ?> - * ``` - * Example: Using sha256 hash - * - * ```php - * seeBinaryResponseEquals(hash("sha256", base64_decode($fileData)), 'sha256'); - * ?> - * ``` - * - * @param string $hash the hashed data response expected - * @param string $algo the hash algorithm to use. Default md5. - * @part json - * @part xml - * @see \Codeception\Module\REST::seeBinaryResponseEquals() + * Dont See In Opened Email Priority + * + * Checks that the priority of the opened email does not contain $expected + * + * @param string $expected priority + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailPriority() */ - public function seeBinaryResponseEquals($hash, $algo = "md5") { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeBinaryResponseEquals', func_get_args())); + public function dontSeeInOpenedEmailPriority($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInOpenedEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if the hash of a binary response is exactly the same as provided. - * Parameter can be passed as any hash string supported by hash(), with an - * optional second parameter to specify the hash type, which defaults to md5. - * - * Example: Using md5 hash key - * - * ```php - * seeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded"); - * ?> - * ``` - * - * Example: Using md5 for a file contents - * - * ```php - * seeBinaryResponseEquals(md5($fileData)); - * ?> - * ``` - * Example: Using sha256 hash - * - * ```php - * seeBinaryResponseEquals(hash("sha256", base64_decode($fileData)), 'sha256'); - * ?> - * ``` - * - * @param string $hash the hashed data response expected - * @param string $algo the hash algorithm to use. Default md5. - * @part json - * @part xml - * @see \Codeception\Module\REST::seeBinaryResponseEquals() + * Dont See In Opened Email Priority + * + * Checks that the priority of the opened email does not contain $expected + * + * @param string $expected priority + * @see \Codeception\Module\MailHog::dontSeeInOpenedEmailPriority() */ - public function canSeeBinaryResponseEquals($hash, $algo = "md5") { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeBinaryResponseEquals', func_get_args())); + public function cantSeeInOpenedEmailPriority($expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInOpenedEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Checks if the hash of a binary response is not the same as provided. - * - * ```php - * dontSeeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded"); - * ?> - * ``` - * Opposite to `seeBinaryResponseEquals` - * - * @param string $hash the hashed data response expected - * @param string $algo the hash algorithm to use. Default md5. - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeBinaryResponseEquals() + * See In Email Priority + * + * Checks that the priority of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected priority + * @see \Codeception\Module\MailHog::seeInEmailPriority() */ - public function dontSeeBinaryResponseEquals($hash, $algo = "md5") { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeBinaryResponseEquals', func_get_args())); + public function seeInEmailPriority($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if the hash of a binary response is not the same as provided. - * - * ```php - * dontSeeBinaryResponseEquals("8c90748342f19b195b9c6b4eff742ded"); - * ?> - * ``` - * Opposite to `seeBinaryResponseEquals` - * - * @param string $hash the hashed data response expected - * @param string $algo the hash algorithm to use. Default md5. - * @part json - * @part xml - * @see \Codeception\Module\REST::dontSeeBinaryResponseEquals() + * See In Email Priority + * + * Checks that the priority of $email contains $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected priority + * @see \Codeception\Module\MailHog::seeInEmailPriority() */ - public function cantSeeBinaryResponseEquals($hash, $algo = "md5") { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeBinaryResponseEquals', func_get_args())); + public function canSeeInEmailPriority($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Prevents automatic redirects to be followed by the client - * - * ```php - * stopFollowingRedirects(); - * ``` + * Dont See In Email Priority + * + * Checks that the priority of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected priority + * @see \Codeception\Module\MailHog::dontSeeInEmailPriority() + */ + public function dontSeeInEmailPriority($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInEmailPriority', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. * - * @part xml - * @part json - * @see \Codeception\Module\REST::stopFollowingRedirects() + * [!] Conditional Assertion: Test won't be stopped on fail + * Dont See In Email Priority + * + * Checks that the priority of $email does not contain $expected + * + * @param mixed $email a JSON encoded email + * @param string $expected priority + * @see \Codeception\Module\MailHog::dontSeeInEmailPriority() */ - public function stopFollowingRedirects() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('stopFollowingRedirects', func_get_args())); + public function cantSeeInEmailPriority($email, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInEmailPriority', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * - * Enables automatic redirects to be followed by the client - * - * ```php - * startFollowingRedirects(); - * ``` - * - * @part xml - * @part json - * @see \Codeception\Module\REST::startFollowingRedirects() + * @param string $content_type_alternative MIME-part Content-Type + * @return string Body + * @see \Codeception\Module\MailHog::grabBodyFromEmail() */ - public function startFollowingRedirects() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('startFollowingRedirects', func_get_args())); + public function grabBodyFromEmail($content_type_alternative = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabBodyFromEmail', func_get_args())); } @@ -4834,21 +6887,4 @@ public function performOn($element, $actions, $timeout = 10) { public function assertEmptyBrowserConsole() { return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmptyBrowserConsole', func_get_args())); } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Set a backend user session cookie and load the backend index.php. - * - * Use this action to change the backend user and avoid switching between users in the backend module - * "Backend Users" as this will change the user session ID and make it useless for subsequent calls of this action. - * - * @param string $role The backend user who should be logged in. - * @throws ConfigurationException - * @see \TYPO3\TestingFramework\Core\Acceptance\Helper\Login::useExistingSession() - */ - public function useExistingSession($role = "") { - return $this->getScenario()->runStep(new \Codeception\Step\Action('useExistingSession', func_get_args())); - } } diff --git a/Tests/Functional/Manager/SessionManagerTest.php b/Tests/Functional/Manager/SessionManagerTest.php index 46b4984..48da998 100644 --- a/Tests/Functional/Manager/SessionManagerTest.php +++ b/Tests/Functional/Manager/SessionManagerTest.php @@ -28,10 +28,12 @@ * This copyright notice MUST APPEAR in all copies of the script! * ************************************************************* */ +use TYPO3\CMS\Core\Context\Context; use LMS\Flogin\Manager\SessionManager; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Session\UserSessionManager; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; +use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; /** @@ -62,6 +64,11 @@ public function fe_session_can_be_terminated(): void { $user = BackendUtility::getRecord('fe_users', 1); + $context = new Context(); + $GLOBALS['TSFE'] = static::getMockBuilder(TypoScriptFrontendController::class) + ->disableOriginalConstructor() + ->getMock(); + $GLOBALS['TSFE']->fe_user = new FrontendUserAuthentication(); $GLOBALS['TSFE']->fe_user->initializeUserSessionManager(); diff --git a/composer.json b/composer.json index 3a0cc57..acd5b87 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "typo3/cms-core": "^11.5.0", + "typo3/cms-core": "^11.5.3", "lms/routes": "*" }, "autoload": { diff --git a/ext_emconf.php b/ext_emconf.php new file mode 100644 index 0000000..f045541 --- /dev/null +++ b/ext_emconf.php @@ -0,0 +1,18 @@ + 'Frontend Authentication', + 'description' => 'Provides an authentication option for website users.', + 'category' => 'fe', + 'author' => 'Borulko Serhii', + 'author_email' => 'borulkosergey@icloud.com', + 'state' => 'beta', + 'clearCacheOnLoad' => true, + 'version' => '11.0.0', + 'constraints' => [ + 'depends' => [ + 'typo3' => '11.5.3-11.5.99', + 'routes' => '*' + ] + ] +]; \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index 689c986..c9497c5 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -130,6 +130,8 @@ ] ); -if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_flogin'])) { +$cacheConfig = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']; + +if (!array_key_exists('tx_flogin', $cacheConfig)) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_flogin'] = []; }