Best Phake code snippet using PHPUnit7
e0c11857c4630a3e9a5333820d6e3aa4129a4ea4.php
Source:e0c11857c4630a3e9a5333820d6e3aa4129a4ea4.php
1<?php declare(strict_types = 1);2return PHPStan\Cache\CacheItem::__set_state(array(3 'variableKey' => '/var/www/html/web/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php-1594234425',4 'data' => 5 array (6 '43152f0606853c135e18c23e2ba16115' => 7 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(8 'phpDocString' => '/**9 * Makes Drupal\'s test API forward compatible with multiple versions of PHPUnit.10 */',11 'nameScope' => 12 PHPStan\Analyser\NameScope::__set_state(array(13 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',14 'uses' => 15 array (16 ),17 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',18 'functionName' => NULL,19 'templateTypeMap' => 20 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(21 'types' => 22 array (23 ),24 )),25 )),26 )),27 '52ed9a755bddd35ea8a676f3e8342b41' => 28 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(29 'phpDocString' => '/**30 * @todo deprecate this method override in31 * https://www.drupal.org/project/drupal/issues/274258532 *33 * @see \\Drupal\\simpletest\\TestBase::assertTrue()34 */',35 'nameScope' => 36 PHPStan\Analyser\NameScope::__set_state(array(37 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',38 'uses' => 39 array (40 ),41 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',42 'functionName' => 'assertTrue',43 'templateTypeMap' => 44 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(45 'types' => 46 array (47 ),48 )),49 )),50 )),51 '683dd39cd1071a99cb7b78a82fa6c62f' => 52 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(53 'phpDocString' => '/**54 * @todo deprecate this method override in55 * https://www.drupal.org/project/drupal/issues/274258556 *57 * @see \\Drupal\\simpletest\\TestBase::assertFalse()58 */',59 'nameScope' => 60 PHPStan\Analyser\NameScope::__set_state(array(61 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',62 'uses' => 63 array (64 ),65 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',66 'functionName' => 'assertFalse',67 'templateTypeMap' => 68 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(69 'types' => 70 array (71 ),72 )),73 )),74 )),75 '4cb5c3e04f09e40f457cf5cc223baf58' => 76 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(77 'phpDocString' => '/**78 * Forward compatibility for assertStringContainsString.79 */',80 'nameScope' => 81 PHPStan\Analyser\NameScope::__set_state(array(82 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',83 'uses' => 84 array (85 ),86 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',87 'functionName' => 'assertStringContainsString',88 'templateTypeMap' => 89 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(90 'types' => 91 array (92 ),93 )),94 )),95 )),96 'fddc5195b9189b88cf6df2ae1ac24f71' => 97 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(98 'phpDocString' => '/**99 * Forward compatibility for assertStringContainsStringIgnoringCase.100 */',101 'nameScope' => 102 PHPStan\Analyser\NameScope::__set_state(array(103 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',104 'uses' => 105 array (106 ),107 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',108 'functionName' => 'assertStringContainsStringIgnoringCase',109 'templateTypeMap' => 110 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(111 'types' => 112 array (113 ),114 )),115 )),116 )),117 '408fb3579ea0d361e16c1fc5a27fb997' => 118 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(119 'phpDocString' => '/**120 * Forward compatibility for assertStringNotContainsString.121 */',122 'nameScope' => 123 PHPStan\Analyser\NameScope::__set_state(array(124 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',125 'uses' => 126 array (127 ),128 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',129 'functionName' => 'assertStringNotContainsString',130 'templateTypeMap' => 131 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(132 'types' => 133 array (134 ),135 )),136 )),137 )),138 '46790bfcc3ea5cb59e65eee141e28fe3' => 139 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(140 'phpDocString' => '/**141 * Forward compatibility for assertStringNotContainsStringIgnoringCase.142 */',143 'nameScope' => 144 PHPStan\Analyser\NameScope::__set_state(array(145 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',146 'uses' => 147 array (148 ),149 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',150 'functionName' => 'assertStringNotContainsStringIgnoringCase',151 'templateTypeMap' => 152 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(153 'types' => 154 array (155 ),156 )),157 )),158 )),159 '19b43e32b56cda9173c460c6de86f003' => 160 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(161 'phpDocString' => '/**162 * Forward compatibility for assertEqualsCanonicalizing.163 */',164 'nameScope' => 165 PHPStan\Analyser\NameScope::__set_state(array(166 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',167 'uses' => 168 array (169 ),170 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',171 'functionName' => 'assertEqualsCanonicalizing',172 'templateTypeMap' => 173 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(174 'types' => 175 array (176 ),177 )),178 )),179 )),180 '3410136a3247915132ffd2d98aa58786' => 181 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(182 'phpDocString' => '/**183 * Forward compatibility for assertNotEqualsCanonicalizing.184 */',185 'nameScope' => 186 PHPStan\Analyser\NameScope::__set_state(array(187 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',188 'uses' => 189 array (190 ),191 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',192 'functionName' => 'assertNotEqualsCanonicalizing',193 'templateTypeMap' => 194 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(195 'types' => 196 array (197 ),198 )),199 )),200 )),201 '4f804ed5240c07ef43fb40e123b52b8b' => 202 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(203 'phpDocString' => '/**204 * Provides forward-compatibility for assertIsArray().205 */',206 'nameScope' => 207 PHPStan\Analyser\NameScope::__set_state(array(208 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',209 'uses' => 210 array (211 ),212 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',213 'functionName' => 'assertIsArray',214 'templateTypeMap' => 215 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(216 'types' => 217 array (218 ),219 )),220 )),221 )),222 '667cedaed0107e61cab8daef6e82ea68' => 223 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(224 'phpDocString' => '/**225 * Provides forward-compatibility for assertIsBool().226 */',227 'nameScope' => 228 PHPStan\Analyser\NameScope::__set_state(array(229 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',230 'uses' => 231 array (232 ),233 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',234 'functionName' => 'assertIsBool',235 'templateTypeMap' => 236 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(237 'types' => 238 array (239 ),240 )),241 )),242 )),243 '3eac03f47cd12e05a51eb9bb4dc22366' => 244 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(245 'phpDocString' => '/**246 * Provides forward-compatibility for assertIsFloat().247 */',248 'nameScope' => 249 PHPStan\Analyser\NameScope::__set_state(array(250 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',251 'uses' => 252 array (253 ),254 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',255 'functionName' => 'assertIsFloat',256 'templateTypeMap' => 257 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(258 'types' => 259 array (260 ),261 )),262 )),263 )),264 '0a68d44755afb1951db6186713a8b19b' => 265 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(266 'phpDocString' => '/**267 * Provides forward-compatibility for assertIsInt().268 */',269 'nameScope' => 270 PHPStan\Analyser\NameScope::__set_state(array(271 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',272 'uses' => 273 array (274 ),275 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',276 'functionName' => 'assertIsInt',277 'templateTypeMap' => 278 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(279 'types' => 280 array (281 ),282 )),283 )),284 )),285 '86c3b32b0b21d5c3789799bdbe6a5669' => 286 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(287 'phpDocString' => '/**288 * Provides forward-compatibility for assertIsNumeric().289 */',290 'nameScope' => 291 PHPStan\Analyser\NameScope::__set_state(array(292 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',293 'uses' => 294 array (295 ),296 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',297 'functionName' => 'assertIsNumeric',298 'templateTypeMap' => 299 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(300 'types' => 301 array (302 ),303 )),304 )),305 )),306 'ecf4af19d7351ba152af34bd5493df1c' => 307 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(308 'phpDocString' => '/**309 * Provides forward-compatibility for assertIsObject().310 */',311 'nameScope' => 312 PHPStan\Analyser\NameScope::__set_state(array(313 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',314 'uses' => 315 array (316 ),317 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',318 'functionName' => 'assertIsObject',319 'templateTypeMap' => 320 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(321 'types' => 322 array (323 ),324 )),325 )),326 )),327 '60b793421e48bb31959d849cd731c5c4' => 328 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(329 'phpDocString' => '/**330 * Provides forward-compatibility for assertIsResource().331 */',332 'nameScope' => 333 PHPStan\Analyser\NameScope::__set_state(array(334 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',335 'uses' => 336 array (337 ),338 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',339 'functionName' => 'assertIsResource',340 'templateTypeMap' => 341 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(342 'types' => 343 array (344 ),345 )),346 )),347 )),348 'a8393a80ad8c4d6840f9ed38dbe7f51f' => 349 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(350 'phpDocString' => '/**351 * Provides forward-compatibility for assertIsString().352 */',353 'nameScope' => 354 PHPStan\Analyser\NameScope::__set_state(array(355 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',356 'uses' => 357 array (358 ),359 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',360 'functionName' => 'assertIsString',361 'templateTypeMap' => 362 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(363 'types' => 364 array (365 ),366 )),367 )),368 )),369 'de239aa25798973f1cd96e7f93473675' => 370 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(371 'phpDocString' => '/**372 * Provides forward-compatibility for assertIsScalar().373 */',374 'nameScope' => 375 PHPStan\Analyser\NameScope::__set_state(array(376 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',377 'uses' => 378 array (379 ),380 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',381 'functionName' => 'assertIsScalar',382 'templateTypeMap' => 383 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(384 'types' => 385 array (386 ),387 )),388 )),389 )),390 'd328bd0bbee780e128eaeab44c86c7d8' => 391 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(392 'phpDocString' => '/**393 * Provides forward-compatibility for assertIsCallable().394 */',395 'nameScope' => 396 PHPStan\Analyser\NameScope::__set_state(array(397 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',398 'uses' => 399 array (400 ),401 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',402 'functionName' => 'assertIsCallable',403 'templateTypeMap' => 404 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(405 'types' => 406 array (407 ),408 )),409 )),410 )),411 '07660a25445659edb4e42bd1ac111766' => 412 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(413 'phpDocString' => '/**414 * Provides forward-compatibility for assertIsNotArray().415 */',416 'nameScope' => 417 PHPStan\Analyser\NameScope::__set_state(array(418 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',419 'uses' => 420 array (421 ),422 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',423 'functionName' => 'assertIsNotArray',424 'templateTypeMap' => 425 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(426 'types' => 427 array (428 ),429 )),430 )),431 )),432 '90d6e69a77fc8d2f33ff8943bea60ce9' => 433 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(434 'phpDocString' => '/**435 * Provides forward-compatibility for assertIsNotBool().436 */',437 'nameScope' => 438 PHPStan\Analyser\NameScope::__set_state(array(439 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',440 'uses' => 441 array (442 ),443 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',444 'functionName' => 'assertIsNotBool',445 'templateTypeMap' => 446 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(447 'types' => 448 array (449 ),450 )),451 )),452 )),453 'd0bb309b3d736c477c052233a92a735c' => 454 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(455 'phpDocString' => '/**456 * Provides forward-compatibility for assertIsNotFloat().457 */',458 'nameScope' => 459 PHPStan\Analyser\NameScope::__set_state(array(460 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',461 'uses' => 462 array (463 ),464 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',465 'functionName' => 'assertIsNotFloat',466 'templateTypeMap' => 467 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(468 'types' => 469 array (470 ),471 )),472 )),473 )),474 '0f6f9c915b540325e3b4c28dda683be9' => 475 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(476 'phpDocString' => '/**477 * Provides forward-compatibility for assertIsNotInt().478 */',479 'nameScope' => 480 PHPStan\Analyser\NameScope::__set_state(array(481 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',482 'uses' => 483 array (484 ),485 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',486 'functionName' => 'assertIsNotInt',487 'templateTypeMap' => 488 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(489 'types' => 490 array (491 ),492 )),493 )),494 )),495 'c7d6f814e75b21c153f2ee3cdc47877b' => 496 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(497 'phpDocString' => '/**498 * Provides forward-compatibility for assertIsNotNumeric().499 */',500 'nameScope' => 501 PHPStan\Analyser\NameScope::__set_state(array(502 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',503 'uses' => 504 array (505 ),506 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',507 'functionName' => 'assertIsNotNumeric',508 'templateTypeMap' => 509 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(510 'types' => 511 array (512 ),513 )),514 )),515 )),516 '3ed50a59b89056e3e5ae5910c38f6fa6' => 517 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(518 'phpDocString' => '/**519 * Provides forward-compatibility for assertIsNotObject().520 */',521 'nameScope' => 522 PHPStan\Analyser\NameScope::__set_state(array(523 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',524 'uses' => 525 array (526 ),527 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',528 'functionName' => 'assertIsNotObject',529 'templateTypeMap' => 530 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(531 'types' => 532 array (533 ),534 )),535 )),536 )),537 'aee51de2dbf5b31ba2c4f7dbaf3da131' => 538 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(539 'phpDocString' => '/**540 * Provides forward-compatibility for assertIsNotResource().541 */',542 'nameScope' => 543 PHPStan\Analyser\NameScope::__set_state(array(544 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',545 'uses' => 546 array (547 ),548 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',549 'functionName' => 'assertIsNotResource',550 'templateTypeMap' => 551 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(552 'types' => 553 array (554 ),555 )),556 )),557 )),558 '5ad1540968863385fcbdddcb79a59e2e' => 559 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(560 'phpDocString' => '/**561 * Provides forward-compatibility for assertIsNotString().562 */',563 'nameScope' => 564 PHPStan\Analyser\NameScope::__set_state(array(565 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',566 'uses' => 567 array (568 ),569 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',570 'functionName' => 'assertIsNotString',571 'templateTypeMap' => 572 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(573 'types' => 574 array (575 ),576 )),577 )),578 )),579 '84d268f713ed8c203e22b87a83c6f781' => 580 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(581 'phpDocString' => '/**582 * Provides forward-compatibility for assertIsNotScalar().583 */',584 'nameScope' => 585 PHPStan\Analyser\NameScope::__set_state(array(586 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',587 'uses' => 588 array (589 ),590 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',591 'functionName' => 'assertIsNotScalar',592 'templateTypeMap' => 593 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(594 'types' => 595 array (596 ),597 )),598 )),599 )),600 '46ac6c37ec6eaee2719481a7bcba8af4' => 601 PHPStan\PhpDoc\NameScopedPhpDocString::__set_state(array(602 'phpDocString' => '/**603 * Provides forward-compatibility for assertIsNotCallable().604 */',605 'nameScope' => 606 PHPStan\Analyser\NameScope::__set_state(array(607 'namespace' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7',608 'uses' => 609 array (610 ),611 'className' => 'Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit7\\TestCompatibilityTrait',612 'functionName' => 'assertIsNotCallable',613 'templateTypeMap' => 614 PHPStan\Type\Generic\TemplateTypeMap::__set_state(array(615 'types' => 616 array (617 ),618 )),619 )),620 )),621 ),622));...
AllTests.php
Source:AllTests.php
1<?php2/**3 * A test class for running all PHP_CodeSniffer unit tests.4 *5 * @author Greg Sherwood <gsherwood@squiz.net>6 * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)7 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence8 */9namespace PHP_CodeSniffer\Tests;10if ($GLOBALS['PHP_CODESNIFFER_PEAR'] === false) {11 include_once 'Core/AllTests.php';12 include_once 'Standards/AllSniffs.php';13} else {14 include_once 'CodeSniffer/Core/AllTests.php';15 include_once 'CodeSniffer/Standards/AllSniffs.php';16 include_once 'FileList.php';17}18// PHPUnit 7 made the TestSuite run() method incompatible with19// older PHPUnit versions due to return type hints, so maintain20// two different suite objects.21$phpunit7 = false;22if (class_exists('\PHPUnit\Runner\Version') === true) {23 $version = \PHPUnit\Runner\Version::id();24 if ($version[0] === '7') {25 $phpunit7 = true;26 }27}28if ($phpunit7 === true) {29 include_once 'TestSuite7.php';30} else {31 include_once 'TestSuite.php';32}33class PHP_CodeSniffer_AllTests34{35 /**36 * Add all PHP_CodeSniffer test suites into a single test suite.37 *38 * @return \PHPUnit\Framework\TestSuite39 */40 public static function suite()41 {42 $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'] = [];43 $GLOBALS['PHP_CODESNIFFER_TEST_DIRS'] = [];44 // Use a special PHP_CodeSniffer test suite so that we can45 // unset our autoload function after the run.46 $suite = new TestSuite('PHP CodeSniffer');47 $suite->addTest(Core\AllTests::suite());48 $suite->addTest(Standards\AllSniffs::suite());49 return $suite;50 }//end suite()51}//end class...
PHPUnit7
Using AI Code Generation
1require_once 'vendor/autoload.php';2use PHPUnit\Framework\TestCase;3use Phake;4{5 public function testPhake()6 {7 $mock = Phake::mock('stdClass');8 Phake::when($mock)->foo->thenReturn('bar');9 $this->assertEquals('bar', $mock->foo());10 Phake::verify($mock)->foo;11 }12}13. 1 / 1 (100%)14OK (1 test, 1 assertion)15. 1 / 1 (100%)16OK (1 test, 1 assertion)
PHPUnit7
Using AI Code Generation
1use PHPUnit7\Framework\TestCase;2use Phake;3{4 public function testFoo()5 {6 $mock = Phake::mock('Foo');7 Phake::when($mock)->bar()->thenReturn('baz');8 $this->assertEquals('baz', $mock->bar());9 }10}11use PHPUnit8\Framework\TestCase;12use Phake;13{14 public function testFoo()15 {16 $mock = Phake::mock('Foo');17 Phake::when($mock)->bar()->thenReturn('baz');18 $this->assertEquals('baz', $mock->bar());19 }20}21use PHPUnit9\Framework\TestCase;22use Phake;23{24 public function testFoo()25 {26 $mock = Phake::mock('Foo');27 Phake::when($mock)->bar()->thenReturn('baz');28 $this->assertEquals('baz', $mock->bar());29 }30}31use PHPUnit10\Framework\TestCase;32use Phake;33{34 public function testFoo()35 {36 $mock = Phake::mock('Foo');37 Phake::when($mock)->bar()->thenReturn('baz');38 $this->assertEquals('baz', $mock->bar());39 }40}41use PHPUnit11\Framework\TestCase;42use Phake;43{44 public function testFoo()45 {46 $mock = Phake::mock('Foo');47 Phake::when($mock)->bar()->thenReturn('baz');48 $this->assertEquals('baz', $mock->bar());49 }50}51use PHPUnit12\Framework\TestCase;52use Phake;53{54 public function testFoo()55 {56 $mock = Phake::mock('Foo');57 Phake::when($mock)->bar()->thenReturn('baz');58 $this->assertEquals('baz', $mock->bar());59 }60}
PHPUnit7
Using AI Code Generation
1$mock = Phake::mock('PHPUnit7');2$stub = Phake::stub('PHPUnit7');3$spy = Phake::spy('PHPUnit7');4$partialMock = Phake::partialMock('PHPUnit7');5$mock = Phake::mock('PHPUnit8');6$stub = Phake::stub('PHPUnit8');7$spy = Phake::spy('PHPUnit8');8$partialMock = Phake::partialMock('PHPUnit8');9$mock = Phake::mock('PHPUnit4');10$stub = Phake::stub('PHPUnit4');11$spy = Phake::spy('PHPUnit4');12$partialMock = Phake::partialMock('PHPUnit4');13Phake::reset();14$mock = Phake::mock('PHPUnit7');15$stub = Phake::stub('PHPUnit7');16$spy = Phake::spy('PHPUnit7');17$partialMock = Phake::partialMock('PHPUnit7');18Phake::reset();19$mock = Phake::mock('PHPUnit8');20$stub = Phake::stub('PHPUnit8');21$spy = Phake::spy('PHPUnit8');22$partialMock = Phake::partialMock('PHPUnit8');23$mock = Phake::mock('PHPUnit4');24$stub = Phake::stub('
PHPUnit7
Using AI Code Generation
1require_once 'vendor/autoload.php';2use PHPUnit\Framework\TestCase;3use Phake;4{5 public function test()6 {7 $mock = Phake::mock('MyClass');8 Phake::when($mock)->myMethod()->thenReturn('foo');9 $this->assertEquals('foo', $mock->myMethod());10 }11}12. 1 / 1 (100%)13OK (1 test, 1 assertion)
PHPUnit7
Using AI Code Generation
1require 'vendor/autoload.php';2use PHPUnit\Framework\TestCase;3use Phake;4{5 public function testPhake()6 {7 $mock = Phake::mock('SomeClass');8 Phake::when($mock)->someMethod()->thenReturn('foo');9 $this->assertEquals('foo', $mock->someMethod());10 }11}12require 'vendor/autoload.php';13use PHPUnit\Framework\TestCase;14use Phake;15{16 public function testPhake()17 {18 $mock = Phake::mock('SomeClass');19 Phake::when($mock)->someMethod()->thenReturn('foo');20 $this->assertEquals('foo', $mock->someMethod());21 }22}23E 1 / 1 (100%)24E 1 / 1 (100%)25. 1 / 1 (100%)26OK (1 test, 1 assertion)
PHPUnit7
Using AI Code Generation
1use PHPUnit\Framework\TestCase;2{3 public function testPhake()4 {5 $mock = Phake::mock('stdClass');6 Phake::when($mock)->doSomething()->thenReturn('foo');7 $this->assertEquals('foo', $mock->doSomething());8 }9}10use PHPUnit\Framework\TestCase;11{12 public function testPhake()13 {14 $mock = Phake::mock('stdClass');15 Phake::when($mock)->doSomething()->thenReturn('foo');16 $this->assertEquals('foo', $mock->doSomething());17 }18}19. 1 / 1 (100%)20OK (1 test, 1 assertion)21. 1 / 1 (100%)22OK (1 test, 1 assertion)
PHPUnit7
Using AI Code Generation
1require_once 'vendor/autoload.php';2use PHPUnit\Framework\TestCase;3use Phake;4{5 public function testFoo()6 {7 $mock = Phake::mock('SomeClass');8 Phake::when($mock)->someMethod()->thenReturn('foo');9 $this->assertEquals('foo', $mock->someMethod());10 }11}12. 1 / 1 (100%)13OK (1 test, 1 assertion)
PHPUnit7
Using AI Code Generation
1$mock = Phake::mock('PHPUnit7');2$mock->expects(Phake::anyParameters())->method('assertEquals');3$mock->assertEquals(1, 1);4$mock = Phake::mock('PHPUnit8');5$mock->expects(Phake::anyParameters())->method('assertEquals');6$mock->assertEquals(1, 1);7$mock = Phake::mock('PHPUnit7');8$mock->expects(Phake::anyParameters())->method('assertEquals');9$mock->assertEquals(1, 1);10$mock = Phake::mock('PHPUnit8');11$mock->expects(Phake::anyParameters())->method('assertEquals');12$mock->assertEquals(1, 1);13$mock = Phake::mock('PHPUnit7');14$mock->expects(Phake::anyParameters())->method('assertEquals');15$mock->assertEquals(1, 1);16$mock = Phake::mock('PHPUnit8');17$mock->expects(Phake::anyParameters())->method('assertEquals');18$mock->assertEquals(1, 1);19$mock = Phake::mock('PHPUnit7');20$mock->expects(Phake::anyParameters())->method('assertEquals');21$mock->assertEquals(1, 1);22$mock = Phake::mock('PHPUnit8');23$mock->expects(Phake::anyParameters())->method('assertEquals');24$mock->assertEquals(1, 1);25Fatal error: Uncaught TypeError: Argument 1 passed to PHPUnit\Framework\Assert::assertArrayHasKey() must be of the type array, object given, called in /home/username/PhpstormProjects/untitled/vendor/phake/phake/src/Phake/Stubber/AnswerCollection.php on line 49 and defined in /home/username/PhpstormProjects/
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!