├── .env.testing ├── .gitignore ├── .travis.yml ├── README.md ├── assets └── public │ ├── css │ ├── backend.css │ └── frontend.css │ └── js │ ├── backend.js │ ├── customizer.js │ └── frontend.js ├── codeception.dist.yml ├── composer.json ├── languages └── the-plugin-name-text-domain.pot ├── phpcs.xml.dist ├── src ├── App │ ├── Backend │ │ ├── Enqueue.php │ │ ├── Notices.php │ │ └── Settings.php │ ├── Cli │ │ └── Example.php │ ├── Cron │ │ └── Example.php │ ├── Frontend │ │ ├── Enqueue.php │ │ └── Templates.php │ ├── General │ │ ├── PostTypes.php │ │ ├── Queries.php │ │ ├── Shortcodes.php │ │ └── Widgets.php │ └── Rest │ │ └── Example.php ├── Bootstrap.php ├── Common │ ├── Abstracts │ │ └── Base.php │ ├── Functions.php │ ├── Traits │ │ ├── Requester.php │ │ └── Singleton.php │ └── Utils │ │ └── Errors.php ├── Compatibility │ └── Siteground │ │ └── Example.php ├── Config │ ├── Classes.php │ ├── I18n.php │ ├── Plugin.php │ ├── Requirements.php │ └── Setup.php └── Integrations │ ├── Example │ └── Api.php │ └── Widget │ └── HTML_Widget.php ├── templates └── test-template.php ├── tests ├── PluginTestsBootstrap.php ├── _data │ └── .gitkeep ├── _output │ └── .gitkeep ├── _support │ ├── AcceptanceTester.php │ ├── FunctionalTester.php │ ├── Helper │ │ ├── Acceptance.php │ │ ├── Functional.php │ │ ├── Unit.php │ │ └── Wpunit.php │ ├── UnitTester.php │ ├── WpunitTester.php │ └── _generated │ │ ├── AcceptanceTesterActions.php │ │ ├── FunctionalTesterActions.php │ │ ├── UnitTesterActions.php │ │ └── WpunitTesterActions.php ├── acceptance.suite.yml ├── functional.suite.yml ├── unit.suite.yml ├── unit │ └── RandomNameTest.php ├── wpunit.suite.yml └── wpunit │ └── RandomPostTest.php └── the-plugin-name.php /.env.testing: -------------------------------------------------------------------------------- 1 | WP_ROOT_FOLDER=/app/wordpress/ 2 | 3 | # For acceptance and functional tests 4 | TEST_SITE_DB_DSN=mysql:host=wordpress;dbname=wordpress 5 | TEST_SITE_DB_HOST=database 6 | TEST_SITE_DB_NAME=wordpress 7 | TEST_SITE_DB_USER=wordpress 8 | TEST_SITE_DB_PASSWORD=wordpress 9 | TEST_SITE_TABLE_PREFIX=wp_ 10 | TEST_SITE_ADMIN_USERNAME=admin 11 | TEST_SITE_ADMIN_PASSWORD=password 12 | TEST_SITE_WP_ADMIN_PATH=/wp-admin 13 | TEST_SITE_WP_URL=https://wp-strap.lndo.site/wordpress 14 | TEST_SITE_WP_DOMAIN=wp-strap.lndo.site/wordpress 15 | TEST_SITE_ADMIN_EMAIL=admin@email.test 16 | 17 | # For integration tests 18 | TEST_DB_NAME=wordpress 19 | TEST_DB_HOST=database 20 | TEST_DB_USER=wordpress 21 | TEST_DB_PASSWORD=wordpress 22 | TEST_TABLE_PREFIX=wp_ 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .idea 3 | 4 | # Node 5 | node_modules 6 | npm-debug.log 7 | package-lock.json 8 | yarn.lock 9 | 10 | # Composer 11 | vendor 12 | composer.lock 13 | 14 | # PHP 15 | phpunit.xml 16 | phpcs.xml 17 | .phpcs.xml 18 | 19 | # Others 20 | *.diff 21 | *.err 22 | *.orig 23 | *.log 24 | *.rej 25 | *.swo 26 | *.swp 27 | *.vi 28 | *~ 29 | *.sass-cache 30 | *.lock 31 | cache -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - 7.3 7 | 8 | notifications: 9 | email: 10 | on_success: never 11 | on_failure: change 12 | 13 | branches: 14 | only: 15 | - master 16 | 17 | cache: 18 | apt: true 19 | directories: 20 | - node_modules 21 | - $HOME/.composer/cache 22 | 23 | matrix: 24 | fast_finish: true 25 | include: 26 | - php: 7.3 27 | env: WP_VERSION=latest WP_MULTISITE=0 28 | - php: 7.2 29 | env: WP_VERSION=latest WP_MULTISITE=0 30 | - php: 7.1 31 | env: WP_VERSION=latest WP_MULTISITE=0 32 | 33 | install: 34 | - phpenv config-rm xdebug.ini || echo 'No xdebug config.' 35 | - composer install --no-interaction --no-suggest 36 | - phpenv rehash 37 | 38 | script: 39 | # Search for PHP syntax errors. 40 | - find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l 41 | # Run PHPCS. 42 | - composer phpcs 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress Plugin Boilerplate 2 | 3 | [](https://travis-ci.org/github/wp-strap/wordpress-plugin-boilerplate) 4 |  5 |
8 | Plugin boilerplate with modern tools to kickstart your WordPress project 9 | This includes common and modern tools to facilitate plugin development and testing with an organized, object-oriented structure and kick-start a build-workflow for your WordPress plugins. 10 | |
11 |
Depedency | 319 |Description | 320 |Version | 321 |
---|---|---|
326 | | Plugin Requirements | 327 |328 | |
micropackage/requirements | 333 |Allows you to test environment requirements to run your plugin. | 334 |1.0 | 335 |
340 | | PHPCodeSniffer | 341 |342 | |
dealerdirect/phpcodesniffer-composer-installer | 347 |Allows for easy installation of PHP_CodeSniffer coding standards (rulesets) | 348 |0.7.1 | 349 |
wp-coding-standards/wpcs | 352 |Collection of PHP_CodeSniffer rules (sniffs) to validate code developed for WordPress | 353 |* | 354 |
automattic/phpcs-neutron-ruleset | 357 |Set of modern (PHP >7) linting guidelines for WordPress development | 358 |3.3 | 359 |
phpcompatibility/phpcompatibility-wp | 362 |Analyse the codebase of a WordPress-based project for PHP cross-version compatibility | 363 |2.1 | 364 |
369 | | Codeception | 370 |371 | |
lucatume/function-mocker | 376 |A Patchwork powered function mocker to mock function for testing | 377 |1.0 | 378 |
lucatume/wp-browser | 381 |Provides easy acceptance, functional, integration and unit testing for WordPress plugins, themes and whole sites using Codeception | 382 |3.0 | 383 |
Codeception/lib-innerbrowser | 386 |Parent library for all Codeception framework modules and PhpBrowser. | 387 |1.0 | 388 |
codeception/module-asserts | 391 |A Codeception module containing various assertions | 392 |1.0 | 393 |
codeception/module-phpbrowser | 396 |Use to perform web acceptance tests with non-javascript browser | 397 |1.0 | 398 |
codeception/module-webdriver | 401 |Run tests in real browsers using the W3C WebDriver protocol. | 402 |1.0 | 403 |
codeception/module-db | 406 |A database module for Codeception. | 407 |1.0 | 408 |
codeception/module-filesystem | 411 |A Codeception module for testing local filesystem. | 412 |1.0 | 413 |
codeception/module-cli | 416 |A Codeception module for testing basic shell commands and shell output. | 417 |1.0 | 418 |
codeception/module-rest | 421 |A REST module for Codeception | 422 |1.2 | 423 |
codeception/util-universalframework | 426 |Mock framework module used in internal Codeception tests | 427 |1.0 | 428 |
codeception/codeception-progress-reporter | 431 |Reporter for codeception with a progress bar | 432 |4.0.2 | 433 |
' . __( 'This is an example of a notice that appears on the settings page.', 'the-plugin-name-text-domain' ) . '
53 |' .
60 | sprintf( /* translators: %s: file path */
61 | __( 'Error source: %s', 'the-plugin-name-text-domain' ), $source
62 | ) . '
' . $message . '
'; 65 | $message .= $exception ? 'Exception:
' . $exception . '
{$footer}
"; 67 | wp_die( $message, $title ); 68 | } else { 69 | wp_die(); 70 | } 71 | } 72 | 73 | /** 74 | * De-activates the plugin and shows notice error in back-end 75 | * 76 | * @param $message : The error message 77 | * @param string $subtitle : Specified title of the error 78 | * @param string $source : File source of the error 79 | * @param string $title : General title of the error 80 | * @param string $exception 81 | * @since 1.0.0 82 | */ 83 | public static function pluginDie( $message = '', $subtitle = '', $source = '', $exception = '', $title = '' ) { 84 | if ( $message ) { 85 | $plugin = self::getPluginData(); 86 | $title = $title ? $title : $plugin['name'] . ' ' . $plugin['version'] . ' ' . __( '› Plugin Disabled', 'the-plugin-name-text-domain' ); 87 | Errors::writeLog( 88 | [ 89 | 'title' => $title . ' - ' . $subtitle, 90 | 'message' => $message, 91 | 'source' => $source, 92 | 'exception' => $exception, 93 | ] 94 | ); 95 | $source = $source ? '' . 96 | sprintf( /* translators: %s: file path */ 97 | __( 'Error source: %s', 'the-plugin-name-text-domain' ), $source 98 | ) . ' - ' : ''; 99 | $footer = $source . '' . $plugin['uri'] . ''; 100 | $error = "{$message}
{$footer}
"; 101 | global $the_plugin_name_die_notice; 102 | $the_plugin_name_die_notice = $error; 103 | add_action( 'admin_notices', 104 | static function () { 105 | global $the_plugin_name_die_notice; 106 | echo wp_kses_post( 107 | sprintf( 108 | '%s
129 | 130 | 131 |
132 | 7 | * @copyright {{author_copyright}} 8 | * @license {{author_license}} 9 | * @link {{author_url}} 10 | */ 11 | ?> 12 |13 | 20 |
21 | -------------------------------------------------------------------------------- /tests/PluginTestsBootstrap.php: -------------------------------------------------------------------------------- 1 | expectException(MyException::class, function() { 25 | * $this->doSomethingBad(); 26 | * }); 27 | * 28 | * $I->expectException(new MyException(), function() { 29 | * $this->doSomethingBad(); 30 | * }); 31 | * ``` 32 | * If you want to check message or exception code, you can pass them with exception instance: 33 | * ```php 34 | * expectException(new MyException("Don't do bad things"), function() { 37 | * $this->doSomethingBad(); 38 | * }); 39 | * ``` 40 | * 41 | * @deprecated Use expectThrowable() instead 42 | * @param \Exception|string $exception 43 | * @param callable $callback 44 | * @see \Codeception\Module\Asserts::expectException() 45 | */ 46 | public function expectException($exception, $callback) { 47 | return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args())); 48 | } 49 | 50 | 51 | /** 52 | * [!] Method is generated. Documentation taken from corresponding module. 53 | * 54 | * Handles and checks throwables (Exceptions/Errors) called inside the callback function. 55 | * Either throwable class name or throwable instance should be provided. 56 | * 57 | * ```php 58 | * expectThrowable(MyThrowable::class, function() { 60 | * $this->doSomethingBad(); 61 | * }); 62 | * 63 | * $I->expectThrowable(new MyException(), function() { 64 | * $this->doSomethingBad(); 65 | * }); 66 | * ``` 67 | * If you want to check message or throwable code, you can pass them with throwable instance: 68 | * ```php 69 | * expectThrowable(new MyError("Don't do bad things"), function() { 72 | * $this->doSomethingBad(); 73 | * }); 74 | * ``` 75 | * 76 | * @param \Throwable|string $throwable 77 | * @param callable $callback 78 | * @see \Codeception\Module\Asserts::expectThrowable() 79 | */ 80 | public function expectThrowable($throwable, $callback) { 81 | return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args())); 82 | } 83 | 84 | 85 | /** 86 | * [!] Method is generated. Documentation taken from corresponding module. 87 | * 88 | * Asserts that a file does not exist. 89 | * 90 | * @param string $filename 91 | * @param string $message 92 | * @see \Codeception\Module\AbstractAsserts::assertFileNotExists() 93 | */ 94 | public function assertFileNotExists($filename, $message = "") { 95 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); 96 | } 97 | 98 | 99 | /** 100 | * [!] Method is generated. Documentation taken from corresponding module. 101 | * 102 | * Asserts that a value is greater than or equal to another value. 103 | * 104 | * @param $expected 105 | * @param $actual 106 | * @param string $message 107 | * @see \Codeception\Module\AbstractAsserts::assertGreaterOrEquals() 108 | */ 109 | public function assertGreaterOrEquals($expected, $actual, $message = "") { 110 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); 111 | } 112 | 113 | 114 | /** 115 | * [!] Method is generated. Documentation taken from corresponding module. 116 | * 117 | * Asserts that a variable is empty. 118 | * 119 | * @param $actual 120 | * @param string $message 121 | * @see \Codeception\Module\AbstractAsserts::assertIsEmpty() 122 | */ 123 | public function assertIsEmpty($actual, $message = "") { 124 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); 125 | } 126 | 127 | 128 | /** 129 | * [!] Method is generated. Documentation taken from corresponding module. 130 | * 131 | * Asserts that a value is smaller than or equal to another value. 132 | * 133 | * @param $expected 134 | * @param $actual 135 | * @param string $message 136 | * @see \Codeception\Module\AbstractAsserts::assertLessOrEquals() 137 | */ 138 | public function assertLessOrEquals($expected, $actual, $message = "") { 139 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); 140 | } 141 | 142 | 143 | /** 144 | * [!] Method is generated. Documentation taken from corresponding module. 145 | * 146 | * Asserts that a string does not match a given regular expression. 147 | * 148 | * @param string $pattern 149 | * @param string $string 150 | * @param string $message 151 | * @see \Codeception\Module\AbstractAsserts::assertNotRegExp() 152 | */ 153 | public function assertNotRegExp($pattern, $string, $message = "") { 154 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); 155 | } 156 | 157 | 158 | /** 159 | * [!] Method is generated. Documentation taken from corresponding module. 160 | * 161 | * Asserts that a string matches a given regular expression. 162 | * 163 | * @param string $pattern 164 | * @param string $string 165 | * @param string $message 166 | * @see \Codeception\Module\AbstractAsserts::assertRegExp() 167 | */ 168 | public function assertRegExp($pattern, $string, $message = "") { 169 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); 170 | } 171 | 172 | 173 | /** 174 | * [!] Method is generated. Documentation taken from corresponding module. 175 | * 176 | * Evaluates a PHPUnit\Framework\Constraint matcher object. 177 | * 178 | * @param $value 179 | * @param Constraint $constraint 180 | * @param string $message 181 | * @see \Codeception\Module\AbstractAsserts::assertThatItsNot() 182 | */ 183 | public function assertThatItsNot($value, $constraint, $message = "") { 184 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThatItsNot', func_get_args())); 185 | } 186 | 187 | 188 | /** 189 | * [!] Method is generated. Documentation taken from corresponding module. 190 | * 191 | * Asserts that an array has a specified key. 192 | * 193 | * @param int|string $key 194 | * @param array|ArrayAccess $array 195 | * @param string $message 196 | * @see \Codeception\Module\AbstractAsserts::assertArrayHasKey() 197 | */ 198 | public function assertArrayHasKey($key, $array, $message = "") { 199 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); 200 | } 201 | 202 | 203 | /** 204 | * [!] Method is generated. Documentation taken from corresponding module. 205 | * 206 | * Asserts that an array does not have a specified key. 207 | * 208 | * @param int|string $key 209 | * @param array|ArrayAccess $array 210 | * @param string $message 211 | * @see \Codeception\Module\AbstractAsserts::assertArrayNotHasKey() 212 | */ 213 | public function assertArrayNotHasKey($key, $array, $message = "") { 214 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); 215 | } 216 | 217 | 218 | /** 219 | * [!] Method is generated. Documentation taken from corresponding module. 220 | * 221 | * Asserts that a class has a specified attribute. 222 | * 223 | * @param string $attributeName 224 | * @param string $className 225 | * @param string $message 226 | * @see \Codeception\Module\AbstractAsserts::assertClassHasAttribute() 227 | */ 228 | public function assertClassHasAttribute($attributeName, $className, $message = "") { 229 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasAttribute', func_get_args())); 230 | } 231 | 232 | 233 | /** 234 | * [!] Method is generated. Documentation taken from corresponding module. 235 | * 236 | * Asserts that a class has a specified static attribute. 237 | * 238 | * @param string $attributeName 239 | * @param string $className 240 | * @param string $message 241 | * @see \Codeception\Module\AbstractAsserts::assertClassHasStaticAttribute() 242 | */ 243 | public function assertClassHasStaticAttribute($attributeName, $className, $message = "") { 244 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasStaticAttribute', func_get_args())); 245 | } 246 | 247 | 248 | /** 249 | * [!] Method is generated. Documentation taken from corresponding module. 250 | * 251 | * Asserts that a class does not have a specified attribute. 252 | * 253 | * @param string $attributeName 254 | * @param string $className 255 | * @param string $message 256 | * @see \Codeception\Module\AbstractAsserts::assertClassNotHasAttribute() 257 | */ 258 | public function assertClassNotHasAttribute($attributeName, $className, $message = "") { 259 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasAttribute', func_get_args())); 260 | } 261 | 262 | 263 | /** 264 | * [!] Method is generated. Documentation taken from corresponding module. 265 | * 266 | * Asserts that a class does not have a specified static attribute. 267 | * 268 | * @param string $attributeName 269 | * @param string $className 270 | * @param string $message 271 | * @see \Codeception\Module\AbstractAsserts::assertClassNotHasStaticAttribute() 272 | */ 273 | public function assertClassNotHasStaticAttribute($attributeName, $className, $message = "") { 274 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasStaticAttribute', func_get_args())); 275 | } 276 | 277 | 278 | /** 279 | * [!] Method is generated. Documentation taken from corresponding module. 280 | * 281 | * Asserts that a haystack contains a needle. 282 | * 283 | * @param $needle 284 | * @param $haystack 285 | * @param string $message 286 | * @see \Codeception\Module\AbstractAsserts::assertContains() 287 | */ 288 | public function assertContains($needle, $haystack, $message = "") { 289 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); 290 | } 291 | 292 | 293 | /** 294 | * [!] Method is generated. Documentation taken from corresponding module. 295 | * 296 | * @param $needle 297 | * @param $haystack 298 | * @param string $message 299 | * @see \Codeception\Module\AbstractAsserts::assertContainsEquals() 300 | */ 301 | public function assertContainsEquals($needle, $haystack, $message = "") { 302 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsEquals', func_get_args())); 303 | } 304 | 305 | 306 | /** 307 | * [!] Method is generated. Documentation taken from corresponding module. 308 | * 309 | * Asserts that a haystack contains only values of a given type. 310 | * 311 | * @param string $type 312 | * @param $haystack 313 | * @param bool|null $isNativeType 314 | * @param string $message 315 | * @see \Codeception\Module\AbstractAsserts::assertContainsOnly() 316 | */ 317 | public function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = "") { 318 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnly', func_get_args())); 319 | } 320 | 321 | 322 | /** 323 | * [!] Method is generated. Documentation taken from corresponding module. 324 | * 325 | * Asserts that a haystack contains only instances of a given class name. 326 | * 327 | * @param string $className 328 | * @param $haystack 329 | * @param string $message 330 | * @see \Codeception\Module\AbstractAsserts::assertContainsOnlyInstancesOf() 331 | */ 332 | public function assertContainsOnlyInstancesOf($className, $haystack, $message = "") { 333 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnlyInstancesOf', func_get_args())); 334 | } 335 | 336 | 337 | /** 338 | * [!] Method is generated. Documentation taken from corresponding module. 339 | * 340 | * Asserts the number of elements of an array, Countable or Traversable. 341 | * 342 | * @param int $expectedCount 343 | * @param Countable|iterable $haystack 344 | * @param string $message 345 | * @see \Codeception\Module\AbstractAsserts::assertCount() 346 | */ 347 | public function assertCount($expectedCount, $haystack, $message = "") { 348 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); 349 | } 350 | 351 | 352 | /** 353 | * [!] Method is generated. Documentation taken from corresponding module. 354 | * 355 | * Asserts that a directory does not exist. 356 | * 357 | * @param string $directory 358 | * @param string $message 359 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryDoesNotExist() 360 | */ 361 | public function assertDirectoryDoesNotExist($directory, $message = "") { 362 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryDoesNotExist', func_get_args())); 363 | } 364 | 365 | 366 | /** 367 | * [!] Method is generated. Documentation taken from corresponding module. 368 | * 369 | * Asserts that a directory exists. 370 | * 371 | * @param string $directory 372 | * @param string $message 373 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryExists() 374 | */ 375 | public function assertDirectoryExists($directory, $message = "") { 376 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryExists', func_get_args())); 377 | } 378 | 379 | 380 | /** 381 | * [!] Method is generated. Documentation taken from corresponding module. 382 | * 383 | * Asserts that a directory exists and is not readable. 384 | * 385 | * @param string $directory 386 | * @param string $message 387 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsNotReadable() 388 | */ 389 | public function assertDirectoryIsNotReadable($directory, $message = "") { 390 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotReadable', func_get_args())); 391 | } 392 | 393 | 394 | /** 395 | * [!] Method is generated. Documentation taken from corresponding module. 396 | * 397 | * Asserts that a directory exists and is not writable. 398 | * 399 | * @param string $directory 400 | * @param string $message 401 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsNotWritable() 402 | */ 403 | public function assertDirectoryIsNotWritable($directory, $message = "") { 404 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotWritable', func_get_args())); 405 | } 406 | 407 | 408 | /** 409 | * [!] Method is generated. Documentation taken from corresponding module. 410 | * 411 | * Asserts that a directory exists and is readable. 412 | * 413 | * @param string $directory 414 | * @param string $message 415 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsReadable() 416 | */ 417 | public function assertDirectoryIsReadable($directory, $message = "") { 418 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsReadable', func_get_args())); 419 | } 420 | 421 | 422 | /** 423 | * [!] Method is generated. Documentation taken from corresponding module. 424 | * 425 | * Asserts that a directory exists and is writable. 426 | * 427 | * @param string $directory 428 | * @param string $message 429 | * @see \Codeception\Module\AbstractAsserts::assertDirectoryIsWritable() 430 | */ 431 | public function assertDirectoryIsWritable($directory, $message = "") { 432 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsWritable', func_get_args())); 433 | } 434 | 435 | 436 | /** 437 | * [!] Method is generated. Documentation taken from corresponding module. 438 | * 439 | * Asserts that a string does not match a given regular expression. 440 | * 441 | * @param string $pattern 442 | * @param string $string 443 | * @param string $message 444 | * @see \Codeception\Module\AbstractAsserts::assertDoesNotMatchRegularExpression() 445 | */ 446 | public function assertDoesNotMatchRegularExpression($pattern, $string, $message = "") { 447 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDoesNotMatchRegularExpression', func_get_args())); 448 | } 449 | 450 | 451 | /** 452 | * [!] Method is generated. Documentation taken from corresponding module. 453 | * 454 | * Asserts that a variable is empty. 455 | * 456 | * @param $actual 457 | * @param string $message 458 | * @see \Codeception\Module\AbstractAsserts::assertEmpty() 459 | */ 460 | public function assertEmpty($actual, $message = "") { 461 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); 462 | } 463 | 464 | 465 | /** 466 | * [!] Method is generated. Documentation taken from corresponding module. 467 | * 468 | * Asserts that two variables are equal. 469 | * 470 | * @param $expected 471 | * @param $actual 472 | * @param string $message 473 | * @see \Codeception\Module\AbstractAsserts::assertEquals() 474 | */ 475 | public function assertEquals($expected, $actual, $message = "") { 476 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); 477 | } 478 | 479 | 480 | /** 481 | * [!] Method is generated. Documentation taken from corresponding module. 482 | * 483 | * Asserts that two variables are equal (canonicalizing). 484 | * 485 | * @param $expected 486 | * @param $actual 487 | * @param string $message 488 | * @see \Codeception\Module\AbstractAsserts::assertEqualsCanonicalizing() 489 | */ 490 | public function assertEqualsCanonicalizing($expected, $actual, $message = "") { 491 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args())); 492 | } 493 | 494 | 495 | /** 496 | * [!] Method is generated. Documentation taken from corresponding module. 497 | * 498 | * Asserts that two variables are equal (ignoring case). 499 | * 500 | * @param $expected 501 | * @param $actual 502 | * @param string $message 503 | * @see \Codeception\Module\AbstractAsserts::assertEqualsIgnoringCase() 504 | */ 505 | public function assertEqualsIgnoringCase($expected, $actual, $message = "") { 506 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args())); 507 | } 508 | 509 | 510 | /** 511 | * [!] Method is generated. Documentation taken from corresponding module. 512 | * 513 | * Asserts that two variables are equal (with delta). 514 | * 515 | * @param $expected 516 | * @param $actual 517 | * @param float $delta 518 | * @param string $message 519 | * @see \Codeception\Module\AbstractAsserts::assertEqualsWithDelta() 520 | */ 521 | public function assertEqualsWithDelta($expected, $actual, $delta, $message = "") { 522 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args())); 523 | } 524 | 525 | 526 | /** 527 | * [!] Method is generated. Documentation taken from corresponding module. 528 | * 529 | * Asserts that a condition is false. 530 | * 531 | * @param $condition 532 | * @param string $message 533 | * @see \Codeception\Module\AbstractAsserts::assertFalse() 534 | */ 535 | public function assertFalse($condition, $message = "") { 536 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); 537 | } 538 | 539 | 540 | /** 541 | * [!] Method is generated. Documentation taken from corresponding module. 542 | * 543 | * Asserts that a file does not exist. 544 | * 545 | * @param string $filename 546 | * @param string $message 547 | * @see \Codeception\Module\AbstractAsserts::assertFileDoesNotExist() 548 | */ 549 | public function assertFileDoesNotExist($filename, $message = "") { 550 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileDoesNotExist', func_get_args())); 551 | } 552 | 553 | 554 | /** 555 | * [!] Method is generated. Documentation taken from corresponding module. 556 | * 557 | * Asserts that the contents of one file is equal to the contents of another file. 558 | * 559 | * @param string $expected 560 | * @param string $actual 561 | * @param string $message 562 | * @see \Codeception\Module\AbstractAsserts::assertFileEquals() 563 | */ 564 | public function assertFileEquals($expected, $actual, $message = "") { 565 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEquals', func_get_args())); 566 | } 567 | 568 | 569 | /** 570 | * [!] Method is generated. Documentation taken from corresponding module. 571 | * 572 | * Asserts that the contents of one file is equal to the contents of another file (canonicalizing). 573 | * 574 | * @param $expected 575 | * @param $actual 576 | * @param string $message 577 | * @see \Codeception\Module\AbstractAsserts::assertFileEqualsCanonicalizing() 578 | */ 579 | public function assertFileEqualsCanonicalizing($expected, $actual, $message = "") { 580 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsCanonicalizing', func_get_args())); 581 | } 582 | 583 | 584 | /** 585 | * [!] Method is generated. Documentation taken from corresponding module. 586 | * 587 | * Asserts that the contents of one file is equal to the contents of another file (ignoring case). 588 | * 589 | * @param $expected 590 | * @param $actual 591 | * @param string $message 592 | * @see \Codeception\Module\AbstractAsserts::assertFileEqualsIgnoringCase() 593 | */ 594 | public function assertFileEqualsIgnoringCase($expected, $actual, $message = "") { 595 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsIgnoringCase', func_get_args())); 596 | } 597 | 598 | 599 | /** 600 | * [!] Method is generated. Documentation taken from corresponding module. 601 | * 602 | * Asserts that a file exists. 603 | * 604 | * @param string $filename 605 | * @param string $message 606 | * @see \Codeception\Module\AbstractAsserts::assertFileExists() 607 | */ 608 | public function assertFileExists($filename, $message = "") { 609 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); 610 | } 611 | 612 | 613 | /** 614 | * [!] Method is generated. Documentation taken from corresponding module. 615 | * 616 | * Asserts that a file exists and is not readable. 617 | * 618 | * @param string $file 619 | * @param string $message 620 | * @see \Codeception\Module\AbstractAsserts::assertFileIsNotReadable() 621 | */ 622 | public function assertFileIsNotReadable($file, $message = "") { 623 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotReadable', func_get_args())); 624 | } 625 | 626 | 627 | /** 628 | * [!] Method is generated. Documentation taken from corresponding module. 629 | * 630 | * Asserts that a file exists and is not writable. 631 | * 632 | * @param string $file 633 | * @param string $message 634 | * @see \Codeception\Module\AbstractAsserts::assertFileIsNotWritable() 635 | */ 636 | public function assertFileIsNotWritable($file, $message = "") { 637 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotWritable', func_get_args())); 638 | } 639 | 640 | 641 | /** 642 | * [!] Method is generated. Documentation taken from corresponding module. 643 | * 644 | * Asserts that a file exists and is readable. 645 | * 646 | * @param string $file 647 | * @param string $message 648 | * @see \Codeception\Module\AbstractAsserts::assertFileIsReadable() 649 | */ 650 | public function assertFileIsReadable($file, $message = "") { 651 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsReadable', func_get_args())); 652 | } 653 | 654 | 655 | /** 656 | * [!] Method is generated. Documentation taken from corresponding module. 657 | * 658 | * Asserts that a file exists and is writable. 659 | * 660 | * @param string $file 661 | * @param string $message 662 | * @see \Codeception\Module\AbstractAsserts::assertFileIsWritable() 663 | */ 664 | public function assertFileIsWritable($file, $message = "") { 665 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsWritable', func_get_args())); 666 | } 667 | 668 | 669 | /** 670 | * [!] Method is generated. Documentation taken from corresponding module. 671 | * 672 | * Asserts that the contents of one file is not equal to the contents of another file. 673 | * 674 | * @param $expected 675 | * @param $actual 676 | * @param string $message 677 | * @see \Codeception\Module\AbstractAsserts::assertFileNotEquals() 678 | */ 679 | public function assertFileNotEquals($expected, $actual, $message = "") { 680 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEquals', func_get_args())); 681 | } 682 | 683 | 684 | /** 685 | * [!] Method is generated. Documentation taken from corresponding module. 686 | * 687 | * Asserts that the contents of one file is not equal to the contents of another file (canonicalizing). 688 | * 689 | * @param $expected 690 | * @param $actual 691 | * @param string $message 692 | * @see \Codeception\Module\AbstractAsserts::assertFileNotEqualsCanonicalizing() 693 | */ 694 | public function assertFileNotEqualsCanonicalizing($expected, $actual, $message = "") { 695 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsCanonicalizing', func_get_args())); 696 | } 697 | 698 | 699 | /** 700 | * [!] Method is generated. Documentation taken from corresponding module. 701 | * 702 | * Asserts that the contents of one file is not equal to the contents of another file (ignoring case). 703 | * 704 | * @param $expected 705 | * @param $actual 706 | * @param string $message 707 | * @see \Codeception\Module\AbstractAsserts::assertFileNotEqualsIgnoringCase() 708 | */ 709 | public function assertFileNotEqualsIgnoringCase($expected, $actual, $message = "") { 710 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsIgnoringCase', func_get_args())); 711 | } 712 | 713 | 714 | /** 715 | * [!] Method is generated. Documentation taken from corresponding module. 716 | * 717 | * Asserts that a variable is finite. 718 | * 719 | * @param $actual 720 | * @param string $message 721 | * @see \Codeception\Module\AbstractAsserts::assertFinite() 722 | */ 723 | public function assertFinite($actual, $message = "") { 724 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFinite', func_get_args())); 725 | } 726 | 727 | 728 | /** 729 | * [!] Method is generated. Documentation taken from corresponding module. 730 | * 731 | * Asserts that a value is greater than another value. 732 | * 733 | * @param $expected 734 | * @param $actual 735 | * @param string $message 736 | * @see \Codeception\Module\AbstractAsserts::assertGreaterThan() 737 | */ 738 | public function assertGreaterThan($expected, $actual, $message = "") { 739 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); 740 | } 741 | 742 | 743 | /** 744 | * [!] Method is generated. Documentation taken from corresponding module. 745 | * 746 | * Asserts that a value is greater than or equal to another value. 747 | * 748 | * @param $expected 749 | * @param $actual 750 | * @param string $message 751 | * @see \Codeception\Module\AbstractAsserts::assertGreaterThanOrEqual() 752 | */ 753 | public function assertGreaterThanOrEqual($expected, $actual, $message = "") { 754 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); 755 | } 756 | 757 | 758 | /** 759 | * [!] Method is generated. Documentation taken from corresponding module. 760 | * 761 | * Asserts that a variable is infinite. 762 | * 763 | * @param $actual 764 | * @param string $message 765 | * @see \Codeception\Module\AbstractAsserts::assertInfinite() 766 | */ 767 | public function assertInfinite($actual, $message = "") { 768 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInfinite', func_get_args())); 769 | } 770 | 771 | 772 | /** 773 | * [!] Method is generated. Documentation taken from corresponding module. 774 | * 775 | * Asserts that a variable is of a given type. 776 | * 777 | * @param $expected 778 | * @param $actual 779 | * @param string $message 780 | * @see \Codeception\Module\AbstractAsserts::assertInstanceOf() 781 | */ 782 | public function assertInstanceOf($expected, $actual, $message = "") { 783 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); 784 | } 785 | 786 | 787 | /** 788 | * [!] Method is generated. Documentation taken from corresponding module. 789 | * 790 | * Asserts that a variable is of type array. 791 | * 792 | * @param $actual 793 | * @param string $message 794 | * @see \Codeception\Module\AbstractAsserts::assertIsArray() 795 | */ 796 | public function assertIsArray($actual, $message = "") { 797 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args())); 798 | } 799 | 800 | 801 | /** 802 | * [!] Method is generated. Documentation taken from corresponding module. 803 | * 804 | * Asserts that a variable is of type bool. 805 | * 806 | * @param $actual 807 | * @param string $message 808 | * @see \Codeception\Module\AbstractAsserts::assertIsBool() 809 | */ 810 | public function assertIsBool($actual, $message = "") { 811 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args())); 812 | } 813 | 814 | 815 | /** 816 | * [!] Method is generated. Documentation taken from corresponding module. 817 | * 818 | * Asserts that a variable is of type callable. 819 | * 820 | * @param $actual 821 | * @param string $message 822 | * @see \Codeception\Module\AbstractAsserts::assertIsCallable() 823 | */ 824 | public function assertIsCallable($actual, $message = "") { 825 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args())); 826 | } 827 | 828 | 829 | /** 830 | * [!] Method is generated. Documentation taken from corresponding module. 831 | * 832 | * Asserts that a variable is of type resource and is closed. 833 | * 834 | * @param $actual 835 | * @param string $message 836 | * @see \Codeception\Module\AbstractAsserts::assertIsClosedResource() 837 | */ 838 | public function assertIsClosedResource($actual, $message = "") { 839 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsClosedResource', func_get_args())); 840 | } 841 | 842 | 843 | /** 844 | * [!] Method is generated. Documentation taken from corresponding module. 845 | * 846 | * Asserts that a variable is of type float. 847 | * 848 | * @param $actual 849 | * @param string $message 850 | * @see \Codeception\Module\AbstractAsserts::assertIsFloat() 851 | */ 852 | public function assertIsFloat($actual, $message = "") { 853 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args())); 854 | } 855 | 856 | 857 | /** 858 | * [!] Method is generated. Documentation taken from corresponding module. 859 | * 860 | * Asserts that a variable is of type int. 861 | * 862 | * @param $actual 863 | * @param string $message 864 | * @see \Codeception\Module\AbstractAsserts::assertIsInt() 865 | */ 866 | public function assertIsInt($actual, $message = "") { 867 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args())); 868 | } 869 | 870 | 871 | /** 872 | * [!] Method is generated. Documentation taken from corresponding module. 873 | * 874 | * Asserts that a variable is of type iterable. 875 | * 876 | * @param $actual 877 | * @param string $message 878 | * @see \Codeception\Module\AbstractAsserts::assertIsIterable() 879 | */ 880 | public function assertIsIterable($actual, $message = "") { 881 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsIterable', func_get_args())); 882 | } 883 | 884 | 885 | /** 886 | * [!] Method is generated. Documentation taken from corresponding module. 887 | * 888 | * Asserts that a variable is not of type array. 889 | * 890 | * @param $actual 891 | * @param string $message 892 | * @see \Codeception\Module\AbstractAsserts::assertIsNotArray() 893 | */ 894 | public function assertIsNotArray($actual, $message = "") { 895 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args())); 896 | } 897 | 898 | 899 | /** 900 | * [!] Method is generated. Documentation taken from corresponding module. 901 | * 902 | * Asserts that a variable is not of type bool. 903 | * 904 | * @param $actual 905 | * @param string $message 906 | * @see \Codeception\Module\AbstractAsserts::assertIsNotBool() 907 | */ 908 | public function assertIsNotBool($actual, $message = "") { 909 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args())); 910 | } 911 | 912 | 913 | /** 914 | * [!] Method is generated. Documentation taken from corresponding module. 915 | * 916 | * Asserts that a variable is not of type callable. 917 | * 918 | * @param $actual 919 | * @param string $message 920 | * @see \Codeception\Module\AbstractAsserts::assertIsNotCallable() 921 | */ 922 | public function assertIsNotCallable($actual, $message = "") { 923 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args())); 924 | } 925 | 926 | 927 | /** 928 | * [!] Method is generated. Documentation taken from corresponding module. 929 | * 930 | * Asserts that a variable is not of type resource. 931 | * 932 | * @param $actual 933 | * @param string $message 934 | * @see \Codeception\Module\AbstractAsserts::assertIsNotClosedResource() 935 | */ 936 | public function assertIsNotClosedResource($actual, $message = "") { 937 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotClosedResource', func_get_args())); 938 | } 939 | 940 | 941 | /** 942 | * [!] Method is generated. Documentation taken from corresponding module. 943 | * 944 | * Asserts that a variable is not of type float. 945 | * 946 | * @param $actual 947 | * @param string $message 948 | * @see \Codeception\Module\AbstractAsserts::assertIsNotFloat() 949 | */ 950 | public function assertIsNotFloat($actual, $message = "") { 951 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args())); 952 | } 953 | 954 | 955 | /** 956 | * [!] Method is generated. Documentation taken from corresponding module. 957 | * 958 | * Asserts that a variable is not of type int. 959 | * 960 | * @param $actual 961 | * @param string $message 962 | * @see \Codeception\Module\AbstractAsserts::assertIsNotInt() 963 | */ 964 | public function assertIsNotInt($actual, $message = "") { 965 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args())); 966 | } 967 | 968 | 969 | /** 970 | * [!] Method is generated. Documentation taken from corresponding module. 971 | * 972 | * Asserts that a variable is not of type iterable. 973 | * 974 | * @param $actual 975 | * @param string $message 976 | * @see \Codeception\Module\AbstractAsserts::assertIsNotIterable() 977 | */ 978 | public function assertIsNotIterable($actual, $message = "") { 979 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotIterable', func_get_args())); 980 | } 981 | 982 | 983 | /** 984 | * [!] Method is generated. Documentation taken from corresponding module. 985 | * 986 | * Asserts that a variable is not of type numeric. 987 | * 988 | * @param $actual 989 | * @param string $message 990 | * @see \Codeception\Module\AbstractAsserts::assertIsNotNumeric() 991 | */ 992 | public function assertIsNotNumeric($actual, $message = "") { 993 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args())); 994 | } 995 | 996 | 997 | /** 998 | * [!] Method is generated. Documentation taken from corresponding module. 999 | * 1000 | * Asserts that a variable is not of type object. 1001 | * 1002 | * @param $actual 1003 | * @param string $message 1004 | * @see \Codeception\Module\AbstractAsserts::assertIsNotObject() 1005 | */ 1006 | public function assertIsNotObject($actual, $message = "") { 1007 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args())); 1008 | } 1009 | 1010 | 1011 | /** 1012 | * [!] Method is generated. Documentation taken from corresponding module. 1013 | * 1014 | * Asserts that a file/dir exists and is not readable. 1015 | * 1016 | * @param string $filename 1017 | * @param string $message 1018 | * @see \Codeception\Module\AbstractAsserts::assertIsNotReadable() 1019 | */ 1020 | public function assertIsNotReadable($filename, $message = "") { 1021 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotReadable', func_get_args())); 1022 | } 1023 | 1024 | 1025 | /** 1026 | * [!] Method is generated. Documentation taken from corresponding module. 1027 | * 1028 | * Asserts that a variable is not of type resource. 1029 | * 1030 | * @param $actual 1031 | * @param string $message 1032 | * @see \Codeception\Module\AbstractAsserts::assertIsNotResource() 1033 | */ 1034 | public function assertIsNotResource($actual, $message = "") { 1035 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args())); 1036 | } 1037 | 1038 | 1039 | /** 1040 | * [!] Method is generated. Documentation taken from corresponding module. 1041 | * 1042 | * Asserts that a variable is not of type scalar. 1043 | * 1044 | * @param $actual 1045 | * @param string $message 1046 | * @see \Codeception\Module\AbstractAsserts::assertIsNotScalar() 1047 | */ 1048 | public function assertIsNotScalar($actual, $message = "") { 1049 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args())); 1050 | } 1051 | 1052 | 1053 | /** 1054 | * [!] Method is generated. Documentation taken from corresponding module. 1055 | * 1056 | * Asserts that a variable is not of type string. 1057 | * 1058 | * @param $actual 1059 | * @param string $message 1060 | * @see \Codeception\Module\AbstractAsserts::assertIsNotString() 1061 | */ 1062 | public function assertIsNotString($actual, $message = "") { 1063 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args())); 1064 | } 1065 | 1066 | 1067 | /** 1068 | * [!] Method is generated. Documentation taken from corresponding module. 1069 | * 1070 | * Asserts that a file/dir exists and is not writable. 1071 | * 1072 | * @param $filename 1073 | * @param string $message 1074 | * @see \Codeception\Module\AbstractAsserts::assertIsNotWritable() 1075 | */ 1076 | public function assertIsNotWritable($filename, $message = "") { 1077 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotWritable', func_get_args())); 1078 | } 1079 | 1080 | 1081 | /** 1082 | * [!] Method is generated. Documentation taken from corresponding module. 1083 | * 1084 | * Asserts that a variable is of type numeric. 1085 | * 1086 | * @param $actual 1087 | * @param string $message 1088 | * @see \Codeception\Module\AbstractAsserts::assertIsNumeric() 1089 | */ 1090 | public function assertIsNumeric($actual, $message = "") { 1091 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args())); 1092 | } 1093 | 1094 | 1095 | /** 1096 | * [!] Method is generated. Documentation taken from corresponding module. 1097 | * 1098 | * Asserts that a variable is of type object. 1099 | * 1100 | * @param $actual 1101 | * @param string $message 1102 | * @see \Codeception\Module\AbstractAsserts::assertIsObject() 1103 | */ 1104 | public function assertIsObject($actual, $message = "") { 1105 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args())); 1106 | } 1107 | 1108 | 1109 | /** 1110 | * [!] Method is generated. Documentation taken from corresponding module. 1111 | * 1112 | * Asserts that a file/dir is readable. 1113 | * 1114 | * @param $filename 1115 | * @param string $message 1116 | * @see \Codeception\Module\AbstractAsserts::assertIsReadable() 1117 | */ 1118 | public function assertIsReadable($filename, $message = "") { 1119 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsReadable', func_get_args())); 1120 | } 1121 | 1122 | 1123 | /** 1124 | * [!] Method is generated. Documentation taken from corresponding module. 1125 | * 1126 | * Asserts that a variable is of type resource. 1127 | * 1128 | * @param $actual 1129 | * @param string $message 1130 | * @see \Codeception\Module\AbstractAsserts::assertIsResource() 1131 | */ 1132 | public function assertIsResource($actual, $message = "") { 1133 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args())); 1134 | } 1135 | 1136 | 1137 | /** 1138 | * [!] Method is generated. Documentation taken from corresponding module. 1139 | * 1140 | * Asserts that a variable is of type scalar. 1141 | * 1142 | * @param $actual 1143 | * @param string $message 1144 | * @see \Codeception\Module\AbstractAsserts::assertIsScalar() 1145 | */ 1146 | public function assertIsScalar($actual, $message = "") { 1147 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args())); 1148 | } 1149 | 1150 | 1151 | /** 1152 | * [!] Method is generated. Documentation taken from corresponding module. 1153 | * 1154 | * Asserts that a variable is of type string. 1155 | * 1156 | * @param $actual 1157 | * @param string $message 1158 | * @see \Codeception\Module\AbstractAsserts::assertIsString() 1159 | */ 1160 | public function assertIsString($actual, $message = "") { 1161 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args())); 1162 | } 1163 | 1164 | 1165 | /** 1166 | * [!] Method is generated. Documentation taken from corresponding module. 1167 | * 1168 | * Asserts that a file/dir exists and is writable. 1169 | * 1170 | * @param $filename 1171 | * @param string $message 1172 | * @see \Codeception\Module\AbstractAsserts::assertIsWritable() 1173 | */ 1174 | public function assertIsWritable($filename, $message = "") { 1175 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsWritable', func_get_args())); 1176 | } 1177 | 1178 | 1179 | /** 1180 | * [!] Method is generated. Documentation taken from corresponding module. 1181 | * 1182 | * Asserts that a string is a valid JSON string. 1183 | * 1184 | * @param string $actualJson 1185 | * @param string $message 1186 | * @see \Codeception\Module\AbstractAsserts::assertJson() 1187 | */ 1188 | public function assertJson($actualJson, $message = "") { 1189 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJson', func_get_args())); 1190 | } 1191 | 1192 | 1193 | /** 1194 | * [!] Method is generated. Documentation taken from corresponding module. 1195 | * 1196 | * Asserts that two JSON files are equal. 1197 | * 1198 | * @param string $expectedFile 1199 | * @param string $actualFile 1200 | * @param string $message 1201 | * @see \Codeception\Module\AbstractAsserts::assertJsonFileEqualsJsonFile() 1202 | */ 1203 | public function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = "") { 1204 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileEqualsJsonFile', func_get_args())); 1205 | } 1206 | 1207 | 1208 | /** 1209 | * [!] Method is generated. Documentation taken from corresponding module. 1210 | * 1211 | * Asserts that two JSON files are not equal. 1212 | * 1213 | * @param string $expectedFile 1214 | * @param string $actualFile 1215 | * @param string $message 1216 | * @see \Codeception\Module\AbstractAsserts::assertJsonFileNotEqualsJsonFile() 1217 | */ 1218 | public function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = "") { 1219 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileNotEqualsJsonFile', func_get_args())); 1220 | } 1221 | 1222 | 1223 | /** 1224 | * [!] Method is generated. Documentation taken from corresponding module. 1225 | * 1226 | * Asserts that the generated JSON encoded object and the content of the given file are equal. 1227 | * 1228 | * @param string $expectedFile 1229 | * @param string $actualJson 1230 | * @param string $message 1231 | * @see \Codeception\Module\AbstractAsserts::assertJsonStringEqualsJsonFile() 1232 | */ 1233 | public function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = "") { 1234 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonFile', func_get_args())); 1235 | } 1236 | 1237 | 1238 | /** 1239 | * [!] Method is generated. Documentation taken from corresponding module. 1240 | * 1241 | * Asserts that two given JSON encoded objects or arrays are equal. 1242 | * 1243 | * @param string $expectedJson 1244 | * @param string $actualJson 1245 | * @param string $message 1246 | * @see \Codeception\Module\AbstractAsserts::assertJsonStringEqualsJsonString() 1247 | */ 1248 | public function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = "") { 1249 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonString', func_get_args())); 1250 | } 1251 | 1252 | 1253 | /** 1254 | * [!] Method is generated. Documentation taken from corresponding module. 1255 | * 1256 | * Asserts that the generated JSON encoded object and the content of the given file are not equal. 1257 | * 1258 | * @param string $expectedFile 1259 | * @param string $actualJson 1260 | * @param string $message 1261 | * @see \Codeception\Module\AbstractAsserts::assertJsonStringNotEqualsJsonFile() 1262 | */ 1263 | public function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = "") { 1264 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonFile', func_get_args())); 1265 | } 1266 | 1267 | 1268 | /** 1269 | * [!] Method is generated. Documentation taken from corresponding module. 1270 | * 1271 | * Asserts that two given JSON encoded objects or arrays are not equal. 1272 | * 1273 | * @param string $expectedJson 1274 | * @param string $actualJson 1275 | * @param string $message 1276 | * @see \Codeception\Module\AbstractAsserts::assertJsonStringNotEqualsJsonString() 1277 | */ 1278 | public function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = "") { 1279 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonString', func_get_args())); 1280 | } 1281 | 1282 | 1283 | /** 1284 | * [!] Method is generated. Documentation taken from corresponding module. 1285 | * 1286 | * Asserts that a value is smaller than another value. 1287 | * 1288 | * @param $expected 1289 | * @param $actual 1290 | * @param string $message 1291 | * @see \Codeception\Module\AbstractAsserts::assertLessThan() 1292 | */ 1293 | public function assertLessThan($expected, $actual, $message = "") { 1294 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); 1295 | } 1296 | 1297 | 1298 | /** 1299 | * [!] Method is generated. Documentation taken from corresponding module. 1300 | * 1301 | * Asserts that a value is smaller than or equal to another value. 1302 | * 1303 | * @param $expected 1304 | * @param $actual 1305 | * @param string $message 1306 | * @see \Codeception\Module\AbstractAsserts::assertLessThanOrEqual() 1307 | */ 1308 | public function assertLessThanOrEqual($expected, $actual, $message = "") { 1309 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); 1310 | } 1311 | 1312 | 1313 | /** 1314 | * [!] Method is generated. Documentation taken from corresponding module. 1315 | * 1316 | * Asserts that a string matches a given regular expression. 1317 | * 1318 | * @param string $pattern 1319 | * @param string $string 1320 | * @param string $message 1321 | * @see \Codeception\Module\AbstractAsserts::assertMatchesRegularExpression() 1322 | */ 1323 | public function assertMatchesRegularExpression($pattern, $string, $message = "") { 1324 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertMatchesRegularExpression', func_get_args())); 1325 | } 1326 | 1327 | 1328 | /** 1329 | * [!] Method is generated. Documentation taken from corresponding module. 1330 | * 1331 | * Asserts that a variable is nan. 1332 | * 1333 | * @param $actual 1334 | * @param string $message 1335 | * @see \Codeception\Module\AbstractAsserts::assertNan() 1336 | */ 1337 | public function assertNan($actual, $message = "") { 1338 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNan', func_get_args())); 1339 | } 1340 | 1341 | 1342 | /** 1343 | * [!] Method is generated. Documentation taken from corresponding module. 1344 | * 1345 | * Asserts that a haystack does not contain a needle. 1346 | * 1347 | * @param $needle 1348 | * @param $haystack 1349 | * @param string $message 1350 | * @see \Codeception\Module\AbstractAsserts::assertNotContains() 1351 | */ 1352 | public function assertNotContains($needle, $haystack, $message = "") { 1353 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); 1354 | } 1355 | 1356 | 1357 | /** 1358 | * [!] Method is generated. Documentation taken from corresponding module. 1359 | * 1360 | * 1361 | * @see \Codeception\Module\AbstractAsserts::assertNotContainsEquals() 1362 | */ 1363 | public function assertNotContainsEquals($needle, $haystack, $message = "") { 1364 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsEquals', func_get_args())); 1365 | } 1366 | 1367 | 1368 | /** 1369 | * [!] Method is generated. Documentation taken from corresponding module. 1370 | * 1371 | * Asserts that a haystack does not contain only values of a given type. 1372 | * 1373 | * @param string $type 1374 | * @param $haystack 1375 | * @param bool|null $isNativeType 1376 | * @param string $message 1377 | * @see \Codeception\Module\AbstractAsserts::assertNotContainsOnly() 1378 | */ 1379 | public function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = "") { 1380 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsOnly', func_get_args())); 1381 | } 1382 | 1383 | 1384 | /** 1385 | * [!] Method is generated. Documentation taken from corresponding module. 1386 | * 1387 | * Asserts the number of elements of an array, Countable or Traversable. 1388 | * 1389 | * @param int $expectedCount 1390 | * @param Countable|iterable $haystack 1391 | * @param string $message 1392 | * @see \Codeception\Module\AbstractAsserts::assertNotCount() 1393 | */ 1394 | public function assertNotCount($expectedCount, $haystack, $message = "") { 1395 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotCount', func_get_args())); 1396 | } 1397 | 1398 | 1399 | /** 1400 | * [!] Method is generated. Documentation taken from corresponding module. 1401 | * 1402 | * Asserts that a variable is not empty. 1403 | * 1404 | * @param $actual 1405 | * @param string $message 1406 | * @see \Codeception\Module\AbstractAsserts::assertNotEmpty() 1407 | */ 1408 | public function assertNotEmpty($actual, $message = "") { 1409 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); 1410 | } 1411 | 1412 | 1413 | /** 1414 | * [!] Method is generated. Documentation taken from corresponding module. 1415 | * 1416 | * Asserts that two variables are not equal. 1417 | * 1418 | * @param $expected 1419 | * @param $actual 1420 | * @param string $message 1421 | * @see \Codeception\Module\AbstractAsserts::assertNotEquals() 1422 | */ 1423 | public function assertNotEquals($expected, $actual, $message = "") { 1424 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); 1425 | } 1426 | 1427 | 1428 | /** 1429 | * [!] Method is generated. Documentation taken from corresponding module. 1430 | * 1431 | * Asserts that two variables are not equal (canonicalizing). 1432 | * 1433 | * @param $expected 1434 | * @param $actual 1435 | * @param string $message 1436 | * @see \Codeception\Module\AbstractAsserts::assertNotEqualsCanonicalizing() 1437 | */ 1438 | public function assertNotEqualsCanonicalizing($expected, $actual, $message = "") { 1439 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args())); 1440 | } 1441 | 1442 | 1443 | /** 1444 | * [!] Method is generated. Documentation taken from corresponding module. 1445 | * 1446 | * Asserts that two variables are not equal (ignoring case). 1447 | * 1448 | * @param $expected 1449 | * @param $actual 1450 | * @param string $message 1451 | * @see \Codeception\Module\AbstractAsserts::assertNotEqualsIgnoringCase() 1452 | */ 1453 | public function assertNotEqualsIgnoringCase($expected, $actual, $message = "") { 1454 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args())); 1455 | } 1456 | 1457 | 1458 | /** 1459 | * [!] Method is generated. Documentation taken from corresponding module. 1460 | * 1461 | * Asserts that two variables are not equal (with delta). 1462 | * 1463 | * @param $expected 1464 | * @param $actual 1465 | * @param float $delta 1466 | * @param string $message 1467 | * @see \Codeception\Module\AbstractAsserts::assertNotEqualsWithDelta() 1468 | */ 1469 | public function assertNotEqualsWithDelta($expected, $actual, $delta, $message = "") { 1470 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args())); 1471 | } 1472 | 1473 | 1474 | /** 1475 | * [!] Method is generated. Documentation taken from corresponding module. 1476 | * 1477 | * Asserts that a condition is not false. 1478 | * 1479 | * @param $condition 1480 | * @param string $message 1481 | * @see \Codeception\Module\AbstractAsserts::assertNotFalse() 1482 | */ 1483 | public function assertNotFalse($condition, $message = "") { 1484 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args())); 1485 | } 1486 | 1487 | 1488 | /** 1489 | * [!] Method is generated. Documentation taken from corresponding module. 1490 | * 1491 | * Asserts that a variable is not of a given type. 1492 | * 1493 | * @param $expected 1494 | * @param $actual 1495 | * @param string $message 1496 | * @see \Codeception\Module\AbstractAsserts::assertNotInstanceOf() 1497 | */ 1498 | public function assertNotInstanceOf($expected, $actual, $message = "") { 1499 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); 1500 | } 1501 | 1502 | 1503 | /** 1504 | * [!] Method is generated. Documentation taken from corresponding module. 1505 | * 1506 | * Asserts that a variable is not null. 1507 | * 1508 | * @param $actual 1509 | * @param string $message 1510 | * @see \Codeception\Module\AbstractAsserts::assertNotNull() 1511 | */ 1512 | public function assertNotNull($actual, $message = "") { 1513 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); 1514 | } 1515 | 1516 | 1517 | /** 1518 | * [!] Method is generated. Documentation taken from corresponding module. 1519 | * 1520 | * Asserts that two variables do not have the same type and value. 1521 | * 1522 | * @param $expected 1523 | * @param $actual 1524 | * @param string $message 1525 | * @see \Codeception\Module\AbstractAsserts::assertNotSame() 1526 | */ 1527 | public function assertNotSame($expected, $actual, $message = "") { 1528 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); 1529 | } 1530 | 1531 | 1532 | /** 1533 | * [!] Method is generated. Documentation taken from corresponding module. 1534 | * 1535 | * Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same. 1536 | * 1537 | * @param Countable|iterable $expected 1538 | * @param Countable|iterable $actual 1539 | * @param string $message 1540 | * @see \Codeception\Module\AbstractAsserts::assertNotSameSize() 1541 | */ 1542 | public function assertNotSameSize($expected, $actual, $message = "") { 1543 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSameSize', func_get_args())); 1544 | } 1545 | 1546 | 1547 | /** 1548 | * [!] Method is generated. Documentation taken from corresponding module. 1549 | * 1550 | * Asserts that a condition is not true. 1551 | * 1552 | * @param $condition 1553 | * @param string $message 1554 | * @see \Codeception\Module\AbstractAsserts::assertNotTrue() 1555 | */ 1556 | public function assertNotTrue($condition, $message = "") { 1557 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args())); 1558 | } 1559 | 1560 | 1561 | /** 1562 | * [!] Method is generated. Documentation taken from corresponding module. 1563 | * 1564 | * Asserts that a variable is null. 1565 | * 1566 | * @param $actual 1567 | * @param string $message 1568 | * @see \Codeception\Module\AbstractAsserts::assertNull() 1569 | */ 1570 | public function assertNull($actual, $message = "") { 1571 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); 1572 | } 1573 | 1574 | 1575 | /** 1576 | * [!] Method is generated. Documentation taken from corresponding module. 1577 | * 1578 | * Asserts that an object has a specified attribute. 1579 | * 1580 | * @param string $attributeName 1581 | * @param object $object 1582 | * @param string $message 1583 | * @see \Codeception\Module\AbstractAsserts::assertObjectHasAttribute() 1584 | */ 1585 | public function assertObjectHasAttribute($attributeName, $object, $message = "") { 1586 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectHasAttribute', func_get_args())); 1587 | } 1588 | 1589 | 1590 | /** 1591 | * [!] Method is generated. Documentation taken from corresponding module. 1592 | * 1593 | * Asserts that an object does not have a specified attribute. 1594 | * 1595 | * @param string $attributeName 1596 | * @param object $object 1597 | * @param string $message 1598 | * @see \Codeception\Module\AbstractAsserts::assertObjectNotHasAttribute() 1599 | */ 1600 | public function assertObjectNotHasAttribute($attributeName, $object, $message = "") { 1601 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectNotHasAttribute', func_get_args())); 1602 | } 1603 | 1604 | 1605 | /** 1606 | * [!] Method is generated. Documentation taken from corresponding module. 1607 | * 1608 | * Asserts that two variables have the same type and value. 1609 | * 1610 | * @param $expected 1611 | * @param $actual 1612 | * @param string $message 1613 | * @see \Codeception\Module\AbstractAsserts::assertSame() 1614 | */ 1615 | public function assertSame($expected, $actual, $message = "") { 1616 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); 1617 | } 1618 | 1619 | 1620 | /** 1621 | * [!] Method is generated. Documentation taken from corresponding module. 1622 | * 1623 | * Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same. 1624 | * 1625 | * @param Countable|iterable $expected 1626 | * @param Countable|iterable $actual 1627 | * @param string $message 1628 | * @see \Codeception\Module\AbstractAsserts::assertSameSize() 1629 | */ 1630 | public function assertSameSize($expected, $actual, $message = "") { 1631 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSameSize', func_get_args())); 1632 | } 1633 | 1634 | 1635 | /** 1636 | * [!] Method is generated. Documentation taken from corresponding module. 1637 | * 1638 | * @param string $needle 1639 | * @param string $haystack 1640 | * @param string $message 1641 | * @see \Codeception\Module\AbstractAsserts::assertStringContainsString() 1642 | */ 1643 | public function assertStringContainsString($needle, $haystack, $message = "") { 1644 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args())); 1645 | } 1646 | 1647 | 1648 | /** 1649 | * [!] Method is generated. Documentation taken from corresponding module. 1650 | * 1651 | * 1652 | * @see \Codeception\Module\AbstractAsserts::assertStringContainsStringIgnoringCase() 1653 | */ 1654 | public function assertStringContainsStringIgnoringCase($needle, $haystack, $message = "") { 1655 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args())); 1656 | } 1657 | 1658 | 1659 | /** 1660 | * [!] Method is generated. Documentation taken from corresponding module. 1661 | * 1662 | * Asserts that a string ends not with a given suffix. 1663 | * 1664 | * @param string $suffix 1665 | * @param string $string 1666 | * @param string $message 1667 | * @see \Codeception\Module\AbstractAsserts::assertStringEndsNotWith() 1668 | */ 1669 | public function assertStringEndsNotWith($suffix, $string, $message = "") { 1670 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args())); 1671 | } 1672 | 1673 | 1674 | /** 1675 | * [!] Method is generated. Documentation taken from corresponding module. 1676 | * 1677 | * Asserts that a string ends with a given suffix. 1678 | * 1679 | * @param string $suffix 1680 | * @param string $string 1681 | * @param string $message 1682 | * @see \Codeception\Module\AbstractAsserts::assertStringEndsWith() 1683 | */ 1684 | public function assertStringEndsWith($suffix, $string, $message = "") { 1685 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args())); 1686 | } 1687 | 1688 | 1689 | /** 1690 | * [!] Method is generated. Documentation taken from corresponding module. 1691 | * 1692 | * Asserts that the contents of a string is equal to the contents of a file. 1693 | * 1694 | * @param string $expectedFile 1695 | * @param string $actualString 1696 | * @param string $message 1697 | * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFile() 1698 | */ 1699 | public function assertStringEqualsFile($expectedFile, $actualString, $message = "") { 1700 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFile', func_get_args())); 1701 | } 1702 | 1703 | 1704 | /** 1705 | * [!] Method is generated. Documentation taken from corresponding module. 1706 | * 1707 | * Asserts that the contents of a string is equal to the contents of a file (canonicalizing). 1708 | * 1709 | * @param string $expectedFile 1710 | * @param string $actualString 1711 | * @param string $message 1712 | * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFileCanonicalizing() 1713 | */ 1714 | public function assertStringEqualsFileCanonicalizing($expectedFile, $actualString, $message = "") { 1715 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileCanonicalizing', func_get_args())); 1716 | } 1717 | 1718 | 1719 | /** 1720 | * [!] Method is generated. Documentation taken from corresponding module. 1721 | * 1722 | * Asserts that the contents of a string is equal to the contents of a file (ignoring case). 1723 | * 1724 | * @param string $expectedFile 1725 | * @param string $actualString 1726 | * @param string $message 1727 | * @see \Codeception\Module\AbstractAsserts::assertStringEqualsFileIgnoringCase() 1728 | */ 1729 | public function assertStringEqualsFileIgnoringCase($expectedFile, $actualString, $message = "") { 1730 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileIgnoringCase', func_get_args())); 1731 | } 1732 | 1733 | 1734 | /** 1735 | * [!] Method is generated. Documentation taken from corresponding module. 1736 | * 1737 | * Asserts that a string matches a given format string. 1738 | * 1739 | * @param string $format 1740 | * @param string $string 1741 | * @param string $message 1742 | * @see \Codeception\Module\AbstractAsserts::assertStringMatchesFormat() 1743 | */ 1744 | public function assertStringMatchesFormat($format, $string, $message = "") { 1745 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormat', func_get_args())); 1746 | } 1747 | 1748 | 1749 | /** 1750 | * [!] Method is generated. Documentation taken from corresponding module. 1751 | * 1752 | * Asserts that a string matches a given format file. 1753 | * 1754 | * @param string $formatFile 1755 | * @param string $string 1756 | * @param string $message 1757 | * @see \Codeception\Module\AbstractAsserts::assertStringMatchesFormatFile() 1758 | */ 1759 | public function assertStringMatchesFormatFile($formatFile, $string, $message = "") { 1760 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormatFile', func_get_args())); 1761 | } 1762 | 1763 | 1764 | /** 1765 | * [!] Method is generated. Documentation taken from corresponding module. 1766 | * 1767 | * @param string $needle 1768 | * @param string $haystack 1769 | * @param string $message 1770 | * @see \Codeception\Module\AbstractAsserts::assertStringNotContainsString() 1771 | */ 1772 | public function assertStringNotContainsString($needle, $haystack, $message = "") { 1773 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args())); 1774 | } 1775 | 1776 | 1777 | /** 1778 | * [!] Method is generated. Documentation taken from corresponding module. 1779 | * 1780 | * @param string $needle 1781 | * @param string $haystack 1782 | * @param string $message 1783 | * @see \Codeception\Module\AbstractAsserts::assertStringNotContainsStringIgnoringCase() 1784 | */ 1785 | public function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = "") { 1786 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args())); 1787 | } 1788 | 1789 | 1790 | /** 1791 | * [!] Method is generated. Documentation taken from corresponding module. 1792 | * 1793 | * Asserts that the contents of a string is not equal to the contents of a file. 1794 | * 1795 | * @param string $expectedFile 1796 | * @param string $actualString 1797 | * @param string $message 1798 | * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFile() 1799 | */ 1800 | public function assertStringNotEqualsFile($expectedFile, $actualString, $message = "") { 1801 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFile', func_get_args())); 1802 | } 1803 | 1804 | 1805 | /** 1806 | * [!] Method is generated. Documentation taken from corresponding module. 1807 | * 1808 | * Asserts that the contents of a string is not equal to the contents of a file (canonicalizing). 1809 | * @param string $expectedFile 1810 | * @param string $actualString 1811 | * @param string $message 1812 | * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFileCanonicalizing() 1813 | */ 1814 | public function assertStringNotEqualsFileCanonicalizing($expectedFile, $actualString, $message = "") { 1815 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileCanonicalizing', func_get_args())); 1816 | } 1817 | 1818 | 1819 | /** 1820 | * [!] Method is generated. Documentation taken from corresponding module. 1821 | * 1822 | * Asserts that the contents of a string is not equal to the contents of a file (ignoring case). 1823 | * 1824 | * @param string $expectedFile 1825 | * @param string $actualString 1826 | * @param string $message 1827 | * @see \Codeception\Module\AbstractAsserts::assertStringNotEqualsFileIgnoringCase() 1828 | */ 1829 | public function assertStringNotEqualsFileIgnoringCase($expectedFile, $actualString, $message = "") { 1830 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileIgnoringCase', func_get_args())); 1831 | } 1832 | 1833 | 1834 | /** 1835 | * [!] Method is generated. Documentation taken from corresponding module. 1836 | * 1837 | * Asserts that a string does not match a given format string. 1838 | * 1839 | * @param string $format 1840 | * @param string $string 1841 | * @param string $message 1842 | * @see \Codeception\Module\AbstractAsserts::assertStringNotMatchesFormat() 1843 | */ 1844 | public function assertStringNotMatchesFormat($format, $string, $message = "") { 1845 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormat', func_get_args())); 1846 | } 1847 | 1848 | 1849 | /** 1850 | * [!] Method is generated. Documentation taken from corresponding module. 1851 | * 1852 | * Asserts that a string does not match a given format string. 1853 | * 1854 | * @param string $formatFile 1855 | * @param string $string 1856 | * @param string $message 1857 | * @see \Codeception\Module\AbstractAsserts::assertStringNotMatchesFormatFile() 1858 | */ 1859 | public function assertStringNotMatchesFormatFile($formatFile, $string, $message = "") { 1860 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormatFile', func_get_args())); 1861 | } 1862 | 1863 | 1864 | /** 1865 | * [!] Method is generated. Documentation taken from corresponding module. 1866 | * 1867 | * Asserts that a string starts not with a given prefix. 1868 | * 1869 | * @param string $prefix 1870 | * @param string $string 1871 | * @param string $message 1872 | * @see \Codeception\Module\AbstractAsserts::assertStringStartsNotWith() 1873 | */ 1874 | public function assertStringStartsNotWith($prefix, $string, $message = "") { 1875 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args())); 1876 | } 1877 | 1878 | 1879 | /** 1880 | * [!] Method is generated. Documentation taken from corresponding module. 1881 | * 1882 | * Asserts that a string starts with a given prefix. 1883 | * 1884 | * @param string $prefix 1885 | * @param string $string 1886 | * @param string $message 1887 | * @see \Codeception\Module\AbstractAsserts::assertStringStartsWith() 1888 | */ 1889 | public function assertStringStartsWith($prefix, $string, $message = "") { 1890 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args())); 1891 | } 1892 | 1893 | 1894 | /** 1895 | * [!] Method is generated. Documentation taken from corresponding module. 1896 | * 1897 | * Evaluates a PHPUnit\Framework\Constraint matcher object. 1898 | * 1899 | * @param $value 1900 | * @param Constraint $constraint 1901 | * @param string $message 1902 | * @see \Codeception\Module\AbstractAsserts::assertThat() 1903 | */ 1904 | public function assertThat($value, $constraint, $message = "") { 1905 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThat', func_get_args())); 1906 | } 1907 | 1908 | 1909 | /** 1910 | * [!] Method is generated. Documentation taken from corresponding module. 1911 | * 1912 | * Asserts that a condition is true. 1913 | * 1914 | * @param $condition 1915 | * @param string $message 1916 | * @see \Codeception\Module\AbstractAsserts::assertTrue() 1917 | */ 1918 | public function assertTrue($condition, $message = "") { 1919 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); 1920 | } 1921 | 1922 | 1923 | /** 1924 | * [!] Method is generated. Documentation taken from corresponding module. 1925 | * 1926 | * Asserts that two XML files are equal. 1927 | * 1928 | * @param string $expectedFile 1929 | * @param string $actualFile 1930 | * @param string $message 1931 | * @see \Codeception\Module\AbstractAsserts::assertXmlFileEqualsXmlFile() 1932 | */ 1933 | public function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = "") { 1934 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileEqualsXmlFile', func_get_args())); 1935 | } 1936 | 1937 | 1938 | /** 1939 | * [!] Method is generated. Documentation taken from corresponding module. 1940 | * 1941 | * Asserts that two XML files are not equal. 1942 | * 1943 | * @param string $expectedFile 1944 | * @param string $actualFile 1945 | * @param string $message 1946 | * @see \Codeception\Module\AbstractAsserts::assertXmlFileNotEqualsXmlFile() 1947 | */ 1948 | public function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = "") { 1949 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileNotEqualsXmlFile', func_get_args())); 1950 | } 1951 | 1952 | 1953 | /** 1954 | * [!] Method is generated. Documentation taken from corresponding module. 1955 | * 1956 | * Asserts that two XML documents are equal. 1957 | * 1958 | * @param string $expectedFile 1959 | * @param DOMDocument|string $actualXml 1960 | * @param string $message 1961 | * @see \Codeception\Module\AbstractAsserts::assertXmlStringEqualsXmlFile() 1962 | */ 1963 | public function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = "") { 1964 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlFile', func_get_args())); 1965 | } 1966 | 1967 | 1968 | /** 1969 | * [!] Method is generated. Documentation taken from corresponding module. 1970 | * 1971 | * Asserts that two XML documents are equal. 1972 | * 1973 | * @param DOMDocument|string $expectedXml 1974 | * @param DOMDocument|string $actualXml 1975 | * @param string $message 1976 | * @see \Codeception\Module\AbstractAsserts::assertXmlStringEqualsXmlString() 1977 | */ 1978 | public function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = "") { 1979 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlString', func_get_args())); 1980 | } 1981 | 1982 | 1983 | /** 1984 | * [!] Method is generated. Documentation taken from corresponding module. 1985 | * 1986 | * Asserts that two XML documents are not equal. 1987 | * 1988 | * @param string $expectedFile 1989 | * @param DOMDocument|string $actualXml 1990 | * @param string $message 1991 | * @see \Codeception\Module\AbstractAsserts::assertXmlStringNotEqualsXmlFile() 1992 | */ 1993 | public function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = "") { 1994 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlFile', func_get_args())); 1995 | } 1996 | 1997 | 1998 | /** 1999 | * [!] Method is generated. Documentation taken from corresponding module. 2000 | * 2001 | * Asserts that two XML documents are not equal. 2002 | * 2003 | * @param DOMDocument|string $expectedXml 2004 | * @param DOMDocument|string $actualXml 2005 | * @param string $message 2006 | * @see \Codeception\Module\AbstractAsserts::assertXmlStringNotEqualsXmlString() 2007 | */ 2008 | public function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = "") { 2009 | return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlString', func_get_args())); 2010 | } 2011 | 2012 | 2013 | /** 2014 | * [!] Method is generated. Documentation taken from corresponding module. 2015 | * 2016 | * Fails a test with the given message. 2017 | * 2018 | * @param string $message 2019 | * @see \Codeception\Module\AbstractAsserts::fail() 2020 | */ 2021 | public function fail($message = "") { 2022 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args())); 2023 | } 2024 | 2025 | 2026 | /** 2027 | * [!] Method is generated. Documentation taken from corresponding module. 2028 | * 2029 | * Mark the test as incomplete. 2030 | * 2031 | * @param string $message 2032 | * @see \Codeception\Module\AbstractAsserts::markTestIncomplete() 2033 | */ 2034 | public function markTestIncomplete($message = "") { 2035 | return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestIncomplete', func_get_args())); 2036 | } 2037 | 2038 | 2039 | /** 2040 | * [!] Method is generated. Documentation taken from corresponding module. 2041 | * 2042 | * Mark the test as skipped. 2043 | * 2044 | * @param string $message 2045 | * @see \Codeception\Module\AbstractAsserts::markTestSkipped() 2046 | */ 2047 | public function markTestSkipped($message = "") { 2048 | return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestSkipped', func_get_args())); 2049 | } 2050 | } 2051 | -------------------------------------------------------------------------------- /tests/_support/_generated/WpunitTesterActions.php: -------------------------------------------------------------------------------- 1 | getPluginsFolder(); 27 | * $hello = $this->getPluginsFolder('hello.php'); 28 | * ``` 29 | * 30 | * @param string $path A relative path to append to te plugins directory absolute path. 31 | * 32 | * @return string The absolute path to the `pluginsFolder` path or the same with a relative path appended if `$path` 33 | * is provided. 34 | * 35 | * @throws ModuleConfigException If the path to the plugins folder does not exist. 36 | * @see \Codeception\Module\WPLoader::getPluginsFolder() 37 | */ 38 | public function getPluginsFolder($path = "") { 39 | return $this->getScenario()->runStep(new \Codeception\Step\Action('getPluginsFolder', func_get_args())); 40 | } 41 | 42 | 43 | /** 44 | * [!] Method is generated. Documentation taken from corresponding module. 45 | * 46 | * Accessor method to get the object storing the factories for things. 47 | * This methods gives access to the same factories provided by the 48 | * [Core test suite](https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/). 49 | * 50 | * @return FactoryStore A factory store, proxy to get hold of the Core suite object 51 | * factories. 52 | * 53 | * @example 54 | * ```php 55 | * $postId = $I->factory()->post->create(); 56 | * $userId = $I->factory()->user->create(['role' => 'administrator']); 57 | * ``` 58 | * 59 | * @link https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/ 60 | * @see \Codeception\Module\WPLoader::factory() 61 | */ 62 | public function factory() { 63 | return $this->getScenario()->runStep(new \Codeception\Step\Action('factory', func_get_args())); 64 | } 65 | 66 | 67 | /** 68 | * [!] Method is generated. Documentation taken from corresponding module. 69 | * 70 | * Returns the absolute path to the WordPress content directory. 71 | * 72 | * @example 73 | * ```php 74 | * $content = $this->getContentFolder(); 75 | * $themes = $this->getContentFolder('themes'); 76 | * $twentytwenty = $this->getContentFolder('themes/twentytwenty'); 77 | * ``` 78 | * 79 | * @param string $path An optional path to append to the content directory absolute path. 80 | * 81 | * @return string The content directory absolute path, or a path in it. 82 | * 83 | * @throws ModuleConfigException If the path to the content directory cannot be resolved. 84 | * @see \Codeception\Module\WPLoader::getContentFolder() 85 | */ 86 | public function getContentFolder($path = "") { 87 | return $this->getScenario()->runStep(new \Codeception\Step\Action('getContentFolder', func_get_args())); 88 | } 89 | 90 | 91 | /** 92 | * [!] Method is generated. Documentation taken from corresponding module. 93 | * 94 | * Starts the debug of all WordPress filters and actions. 95 | * 96 | * The method hook on `all` filters and actions to debug their value. 97 | * 98 | * @example 99 | * ```php 100 | * // Start debugging all WordPress filters and action final and initial values. 101 | * $this->startWpFiltersDebug(); 102 | * 103 | * // Run some code firing filters and debug them. 104 | * 105 | * // Stop debugging all WordPress filters and action final and initial values. 106 | * $this->stopWpFiltersDebug(); 107 | * ``` 108 | * 109 | * @param callable|null $format A callback function to format the arguments debug output; the callback will receive 110 | * the array of arguments as input. 111 | * 112 | * @return void 113 | * @see \Codeception\Module\WPLoader::startWpFiltersDebug() 114 | */ 115 | public function startWpFiltersDebug($format = NULL) { 116 | return $this->getScenario()->runStep(new \Codeception\Step\Action('startWpFiltersDebug', func_get_args())); 117 | } 118 | 119 | 120 | /** 121 | * [!] Method is generated. Documentation taken from corresponding module. 122 | * 123 | * Stops the debug of all WordPress filters and actions. 124 | * 125 | * @example 126 | * ```php 127 | * // Start debugging all WordPress filters and action final and initial values. 128 | * $this->startWpFiltersDebug(); 129 | * 130 | * // Run some code firing filters and debug them. 131 | * 132 | * // Stop debugging all WordPress filters and action final and initial values. 133 | * $this->stopWpFiltersDebug(); 134 | * ``` 135 | * 136 | * @return void 137 | * @see \Codeception\Module\WPLoader::stopWpFiltersDebug() 138 | */ 139 | public function stopWpFiltersDebug() { 140 | return $this->getScenario()->runStep(new \Codeception\Step\Action('stopWpFiltersDebug', func_get_args())); 141 | } 142 | 143 | 144 | /** 145 | * [!] Method is generated. Documentation taken from corresponding module. 146 | * 147 | * Debugs a single WordPress filter initial call using Codeception debug functions. 148 | * 149 | * The output will show following the selected output verbosity (`--debug` and `-vvv` CLI options). 150 | * 151 | * @example 152 | * ```php 153 | * // Start debugging all WordPress filters initial value. 154 | * add_filter('all', [$this,'debugWpFilterInitial']); 155 | * 156 | * // Run some code firing filters and debug them. 157 | * 158 | * // Stop debugging all WordPress filters initial value. 159 | * remove_filter('all', [$this,'debugWpFilterInitial']); 160 | * ``` 161 | * 162 | * @param mixed ...$args The filter call arguments. 163 | * 164 | * @return mixed The filter input value, unchanged. 165 | * @see \Codeception\Module\WPLoader::debugWpFilterInitial() 166 | */ 167 | public function debugWpFilterInitial($args = null) { 168 | return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWpFilterInitial', func_get_args())); 169 | } 170 | 171 | 172 | /** 173 | * [!] Method is generated. Documentation taken from corresponding module. 174 | * 175 | * Debugs a single WordPress filter final call using Codeception debug functions. 176 | * 177 | * The output will show following the selected output verbosity (`--debug` and `-vvv` CLI options). 178 | * 179 | * @example 180 | * ```php 181 | * // Start debugging all WordPress filters final value. 182 | * add_filter('all', [$this,'debugWpFilterFinal']); 183 | * 184 | * // Run some code firing filters and debug them. 185 | * 186 | * // Stop debugging all WordPress filters final value. 187 | * remove_filter('all', [$this,'debugWpFilterFinal']); 188 | * ``` 189 | * 190 | * @param mixed ...$args The filter call arguments. 191 | * 192 | * @return mixed The filter input value, unchanged. 193 | * @see \Codeception\Module\WPLoader::debugWpFilterFinal() 194 | */ 195 | public function debugWpFilterFinal($args = null) { 196 | return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWpFilterFinal', func_get_args())); 197 | } 198 | 199 | 200 | /** 201 | * [!] Method is generated. Documentation taken from corresponding module. 202 | * 203 | * Debugs a single WordPress action initial call using Codeception debug functions. 204 | * 205 | * The output will show following the selected output verbosity (`--debug` and `-vvv` CLI options). 206 | * 207 | * @example 208 | * ```php 209 | * // Start debugging all WordPress actions initial value. 210 | * add_action('all', [$this,'debugWpActionInitial']); 211 | * 212 | * // Run some code firing actions and debug them. 213 | * 214 | * // Stop debugging all WordPress actions initial value. 215 | * remove_action('all', [$this,'debugWpActionInitial']); 216 | * ``` 217 | * 218 | * @param mixed ...$args The action call arguments. 219 | * 220 | * @return void 221 | * @see \Codeception\Module\WPLoader::debugWpActionInitial() 222 | */ 223 | public function debugWpActionInitial($args = null) { 224 | return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWpActionInitial', func_get_args())); 225 | } 226 | 227 | 228 | /** 229 | * [!] Method is generated. Documentation taken from corresponding module. 230 | * 231 | * Debugs a single WordPress action final call using Codeception debug functions. 232 | * 233 | * The output will show following the selected output verbosity (`--debug` and `-vvv` CLI options). 234 | * 235 | * @example 236 | * ```php 237 | * // Start debugging all WordPress actions final value. 238 | * add_action('all', [$this,'debugWpActionFinal']); 239 | * 240 | * // Run some code firing actions and debug them. 241 | * 242 | * // Stop debugging all WordPress actions final value. 243 | * remove_action('all', [$this,'debugWpActionFinal']); 244 | * ``` 245 | * 246 | * @param mixed ...$args The action call arguments. 247 | * 248 | * @return void 249 | * @see \Codeception\Module\WPLoader::debugWpActionFinal() 250 | */ 251 | public function debugWpActionFinal($args = null) { 252 | return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWpActionFinal', func_get_args())); 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /tests/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for acceptance tests. 4 | # Perform tests in browser using the WPWebDriver or WPBrowser. 5 | # Use WPDb to set up your initial database fixture. 6 | # If you need both WPWebDriver and WPBrowser tests - create a separate suite. 7 | 8 | actor: AcceptanceTester 9 | modules: 10 | enabled: 11 | - WPDb 12 | - WPBrowser 13 | - \Helper\Acceptance 14 | config: 15 | WPDb: 16 | dsn: '%TEST_SITE_DB_DSN%' 17 | user: '%TEST_SITE_DB_USER%' 18 | password: '%TEST_SITE_DB_PASSWORD%' 19 | dump: 'tests/_data/dump.sql' 20 | #import the dump before the tests; this means the test site database will be repopulated before the tests. 21 | populate: true 22 | # re-import the dump between tests; this means the test site database will be repopulated between the tests. 23 | cleanup: true 24 | waitlock: 10 25 | url: '%TEST_SITE_WP_URL%' 26 | urlReplacement: true #replace the hardcoded dump URL with the one above 27 | tablePrefix: '%TEST_SITE_TABLE_PREFIX%' 28 | WPBrowser: 29 | url: '%TEST_SITE_WP_URL%' 30 | adminUsername: '%TEST_SITE_ADMIN_USERNAME%' 31 | adminPassword: '%TEST_SITE_ADMIN_PASSWORD%' 32 | adminPath: '%TEST_SITE_WP_ADMIN_PATH%' 33 | headers: 34 | X_TEST_REQUEST: 1 35 | X_WPBROWSER_REQUEST: 1 -------------------------------------------------------------------------------- /tests/functional.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for functional tests 4 | # Emulate web requests and make WordPress process them 5 | 6 | actor: FunctionalTester 7 | modules: 8 | enabled: 9 | - WPDb 10 | - WPBrowser 11 | # - WPFilesystem 12 | - Asserts 13 | - \Helper\Functional 14 | config: 15 | WPDb: 16 | dsn: '%TEST_SITE_DB_DSN%' 17 | user: '%TEST_SITE_DB_USER%' 18 | password: '%TEST_SITE_DB_PASSWORD%' 19 | dump: 'tests/_data/dump.sql' 20 | populate: true 21 | cleanup: true 22 | waitlock: 10 23 | url: '%TEST_SITE_WP_URL%' 24 | urlReplacement: true 25 | tablePrefix: '%TEST_SITE_TABLE_PREFIX%' 26 | WPBrowser: 27 | url: '%TEST_SITE_WP_URL%' 28 | adminUsername: '%TEST_SITE_ADMIN_USERNAME%' 29 | adminPassword: '%TEST_SITE_ADMIN_PASSWORD%' 30 | adminPath: '%TEST_SITE_WP_ADMIN_PATH%' 31 | headers: 32 | X_TEST_REQUEST: 1 33 | X_WPBROWSER_REQUEST: 1 34 | 35 | WPFilesystem: 36 | wpRootFolder: '%WP_ROOT_FOLDER%' 37 | plugins: '/wp-content/plugins' 38 | mu-plugins: '/wp-content/mu-plugins' 39 | themes: '/wp-content/themes' 40 | uploads: '/wp-content/uploads' -------------------------------------------------------------------------------- /tests/unit.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for unit tests not relying WordPress code. 4 | 5 | actor: UnitTester 6 | modules: 7 | enabled: 8 | - Asserts 9 | - \Helper\Unit 10 | step_decorators: ~ -------------------------------------------------------------------------------- /tests/unit/RandomNameTest.php: -------------------------------------------------------------------------------- 1 | randomName(); 33 | self::assertNotNull($name); 34 | } 35 | } -------------------------------------------------------------------------------- /tests/wpunit.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | # 3 | # Suite for unit or integration tests that require WordPress functions and classes. 4 | 5 | actor: WpunitTester 6 | modules: 7 | enabled: 8 | - WPLoader 9 | - \Helper\Wpunit 10 | config: 11 | WPLoader: 12 | wpRootFolder: "%WP_ROOT_FOLDER%" 13 | dbName: "%TEST_DB_NAME%" 14 | dbHost: "%TEST_DB_HOST%" 15 | dbUser: "%TEST_DB_USER%" 16 | dbPassword: "%TEST_DB_PASSWORD%" 17 | tablePrefix: "%TEST_TABLE_PREFIX%" 18 | domain: "%TEST_SITE_WP_DOMAIN%" 19 | adminEmail: "%TEST_SITE_ADMIN_EMAIL%" 20 | title: "WP-Strap" 21 | plugins: ['the-plugin-name/the-plugin-name.php'] 22 | activatePlugins: ['the-plugin-name/the-plugin-name.php'] -------------------------------------------------------------------------------- /tests/wpunit/RandomPostTest.php: -------------------------------------------------------------------------------- 1 | root_dir = dirname( dirname( dirname( __FILE__ ) ) ); 22 | } 23 | 24 | public function tearDown(): void 25 | { 26 | // Your tear down methods here. 27 | 28 | // Then... 29 | parent::tearDown(); 30 | } 31 | 32 | // Tests 33 | public function test_it_works() 34 | { 35 | $post = static::factory()->post->create_and_get(); 36 | $this->assertInstanceOf(\WP_Post::class, $post); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /the-plugin-name.php: -------------------------------------------------------------------------------- 1 | 7 | * @copyright {{author_copyright}} 8 | * @license {{author_license}} 9 | * @link {{author_url}} 10 | * 11 | * Plugin Name: {{The Plugin Name}} 12 | * Plugin URI: {{plugin_url}} 13 | * Description: {{plugin_description}} 14 | * Version: {{version}} 15 | * Author: {{author_name}} 16 | * Author URI: {{author_url}} 17 | * Text Domain: the-plugin-name-text-domain 18 | * Domain Path: /languages 19 | * Requires PHP: 7.1 20 | * Requires WP: 5.5.0 21 | * Namespace: ThePluginName 22 | */ 23 | 24 | declare( strict_types = 1 ); 25 | 26 | /** 27 | * Define the default root file of the plugin 28 | * 29 | * @since 1.0.0 30 | */ 31 | const _THE_PLUGIN_NAME_PLUGIN_FILE = __FILE__; 32 | 33 | /** 34 | * Load PSR4 autoloader 35 | * 36 | * @since 1.0.0 37 | */ 38 | $the_plugin_name_autoloader = require plugin_dir_path( _THE_PLUGIN_NAME_PLUGIN_FILE ) . 'vendor/autoload.php'; 39 | 40 | /** 41 | * Setup hooks (activation, deactivation, uninstall) 42 | * 43 | * @since 1.0.0 44 | */ 45 | register_activation_hook( __FILE__, [ 'ThePluginName\Config\Setup', 'activation' ] ); 46 | register_deactivation_hook( __FILE__, [ 'ThePluginName\Config\Setup', 'deactivation' ] ); 47 | register_uninstall_hook( __FILE__, [ 'ThePluginName\Config\Setup', 'uninstall' ] ); 48 | 49 | /** 50 | * Bootstrap the plugin 51 | * 52 | * @since 1.0.0 53 | */ 54 | if ( ! class_exists( '\ThePluginName\Bootstrap' ) ) { 55 | wp_die( __( '{{The Plugin Name}} is unable to find the Bootstrap class.', 'the-plugin-name-text-domain' ) ); 56 | } 57 | add_action( 58 | 'plugins_loaded', 59 | static function () use ( $the_plugin_name_autoloader ) { 60 | /** 61 | * @see \ThePluginName\Bootstrap 62 | */ 63 | try { 64 | new \ThePluginName\Bootstrap( $the_plugin_name_autoloader ); 65 | } catch ( Exception $e ) { 66 | wp_die( __( '{{The Plugin Name}} is unable to run the Bootstrap class.', 'the-plugin-name-text-domain' ) ); 67 | } 68 | } 69 | ); 70 | 71 | /** 72 | * Create a main function for external uses 73 | * 74 | * @return \ThePluginName\Common\Functions 75 | * @since 1.0.0 76 | */ 77 | function the_plugin_name(): \ThePluginName\Common\Functions { 78 | return new \ThePluginName\Common\Functions(); 79 | } 80 | --------------------------------------------------------------------------------