├── .gitignore ├── composer.json ├── composer.lock ├── readme.md └── src ├── LaravelViewTestAssertionsServiceProvider.php └── ViewTestAssertions.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcergolj/laravel-view-test-assertions", 3 | "description": "Missing Laravel view's test assertions", 4 | "type": "package", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Janez Cergolj", 9 | "email": "me@jcergolj.me.uk" 10 | } 11 | ], 12 | "minimum-stability": "dev", 13 | "prefer-stable" : true, 14 | "require": { 15 | "php": ">=7.4", 16 | "symfony/dom-crawler": "^6.0" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "Jcergolj\\LaravelViewTestAssertions\\": "src/" 21 | } 22 | }, 23 | "extra": { 24 | "laravel": { 25 | "providers": [ 26 | "Jcergolj\\LaravelViewTestAssertions\\LaravelViewTestAssertionsServiceProvider" 27 | ] 28 | } 29 | }, 30 | "require-dev": { 31 | "phpunit/phpunit": "^10.1", 32 | "laravel/pint": "^1.9" 33 | }, 34 | "scripts": { 35 | "pint": "vendor/bin/pint", 36 | "analyse": [ 37 | "@pint" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "92de7b336a988d56ac5fe96f4a0d3745", 8 | "packages": [ 9 | { 10 | "name": "symfony/dom-crawler", 11 | "version": "v6.0.6", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/symfony/dom-crawler.git", 15 | "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/9b4126901a6146c151d95af3868b1e0e30519ea6", 20 | "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=8.0.2", 25 | "symfony/polyfill-ctype": "~1.8", 26 | "symfony/polyfill-mbstring": "~1.0" 27 | }, 28 | "conflict": { 29 | "masterminds/html5": "<2.6" 30 | }, 31 | "require-dev": { 32 | "masterminds/html5": "^2.6", 33 | "symfony/css-selector": "^5.4|^6.0" 34 | }, 35 | "suggest": { 36 | "symfony/css-selector": "" 37 | }, 38 | "type": "library", 39 | "autoload": { 40 | "psr-4": { 41 | "Symfony\\Component\\DomCrawler\\": "" 42 | }, 43 | "exclude-from-classmap": [ 44 | "/Tests/" 45 | ] 46 | }, 47 | "notification-url": "https://packagist.org/downloads/", 48 | "license": [ 49 | "MIT" 50 | ], 51 | "authors": [ 52 | { 53 | "name": "Fabien Potencier", 54 | "email": "fabien@symfony.com" 55 | }, 56 | { 57 | "name": "Symfony Community", 58 | "homepage": "https://symfony.com/contributors" 59 | } 60 | ], 61 | "description": "Eases DOM navigation for HTML and XML documents", 62 | "homepage": "https://symfony.com", 63 | "support": { 64 | "source": "https://github.com/symfony/dom-crawler/tree/v6.0.6" 65 | }, 66 | "funding": [ 67 | { 68 | "url": "https://symfony.com/sponsor", 69 | "type": "custom" 70 | }, 71 | { 72 | "url": "https://github.com/fabpot", 73 | "type": "github" 74 | }, 75 | { 76 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 77 | "type": "tidelift" 78 | } 79 | ], 80 | "time": "2022-03-02T12:58:14+00:00" 81 | }, 82 | { 83 | "name": "symfony/polyfill-ctype", 84 | "version": "v1.25.0", 85 | "source": { 86 | "type": "git", 87 | "url": "https://github.com/symfony/polyfill-ctype.git", 88 | "reference": "30885182c981ab175d4d034db0f6f469898070ab" 89 | }, 90 | "dist": { 91 | "type": "zip", 92 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", 93 | "reference": "30885182c981ab175d4d034db0f6f469898070ab", 94 | "shasum": "" 95 | }, 96 | "require": { 97 | "php": ">=7.1" 98 | }, 99 | "provide": { 100 | "ext-ctype": "*" 101 | }, 102 | "suggest": { 103 | "ext-ctype": "For best performance" 104 | }, 105 | "type": "library", 106 | "extra": { 107 | "branch-alias": { 108 | "dev-main": "1.23-dev" 109 | }, 110 | "thanks": { 111 | "name": "symfony/polyfill", 112 | "url": "https://github.com/symfony/polyfill" 113 | } 114 | }, 115 | "autoload": { 116 | "files": [ 117 | "bootstrap.php" 118 | ], 119 | "psr-4": { 120 | "Symfony\\Polyfill\\Ctype\\": "" 121 | } 122 | }, 123 | "notification-url": "https://packagist.org/downloads/", 124 | "license": [ 125 | "MIT" 126 | ], 127 | "authors": [ 128 | { 129 | "name": "Gert de Pagter", 130 | "email": "BackEndTea@gmail.com" 131 | }, 132 | { 133 | "name": "Symfony Community", 134 | "homepage": "https://symfony.com/contributors" 135 | } 136 | ], 137 | "description": "Symfony polyfill for ctype functions", 138 | "homepage": "https://symfony.com", 139 | "keywords": [ 140 | "compatibility", 141 | "ctype", 142 | "polyfill", 143 | "portable" 144 | ], 145 | "support": { 146 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" 147 | }, 148 | "funding": [ 149 | { 150 | "url": "https://symfony.com/sponsor", 151 | "type": "custom" 152 | }, 153 | { 154 | "url": "https://github.com/fabpot", 155 | "type": "github" 156 | }, 157 | { 158 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 159 | "type": "tidelift" 160 | } 161 | ], 162 | "time": "2021-10-20T20:35:02+00:00" 163 | }, 164 | { 165 | "name": "symfony/polyfill-mbstring", 166 | "version": "v1.25.0", 167 | "source": { 168 | "type": "git", 169 | "url": "https://github.com/symfony/polyfill-mbstring.git", 170 | "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" 171 | }, 172 | "dist": { 173 | "type": "zip", 174 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", 175 | "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", 176 | "shasum": "" 177 | }, 178 | "require": { 179 | "php": ">=7.1" 180 | }, 181 | "provide": { 182 | "ext-mbstring": "*" 183 | }, 184 | "suggest": { 185 | "ext-mbstring": "For best performance" 186 | }, 187 | "type": "library", 188 | "extra": { 189 | "branch-alias": { 190 | "dev-main": "1.23-dev" 191 | }, 192 | "thanks": { 193 | "name": "symfony/polyfill", 194 | "url": "https://github.com/symfony/polyfill" 195 | } 196 | }, 197 | "autoload": { 198 | "files": [ 199 | "bootstrap.php" 200 | ], 201 | "psr-4": { 202 | "Symfony\\Polyfill\\Mbstring\\": "" 203 | } 204 | }, 205 | "notification-url": "https://packagist.org/downloads/", 206 | "license": [ 207 | "MIT" 208 | ], 209 | "authors": [ 210 | { 211 | "name": "Nicolas Grekas", 212 | "email": "p@tchwork.com" 213 | }, 214 | { 215 | "name": "Symfony Community", 216 | "homepage": "https://symfony.com/contributors" 217 | } 218 | ], 219 | "description": "Symfony polyfill for the Mbstring extension", 220 | "homepage": "https://symfony.com", 221 | "keywords": [ 222 | "compatibility", 223 | "mbstring", 224 | "polyfill", 225 | "portable", 226 | "shim" 227 | ], 228 | "support": { 229 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" 230 | }, 231 | "funding": [ 232 | { 233 | "url": "https://symfony.com/sponsor", 234 | "type": "custom" 235 | }, 236 | { 237 | "url": "https://github.com/fabpot", 238 | "type": "github" 239 | }, 240 | { 241 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 242 | "type": "tidelift" 243 | } 244 | ], 245 | "time": "2021-11-30T18:21:41+00:00" 246 | } 247 | ], 248 | "packages-dev": [ 249 | { 250 | "name": "laravel/pint", 251 | "version": "v1.9.0", 252 | "source": { 253 | "type": "git", 254 | "url": "https://github.com/laravel/pint.git", 255 | "reference": "eac5ec3d6b5c96543c682e309a10fdddc9f61d80" 256 | }, 257 | "dist": { 258 | "type": "zip", 259 | "url": "https://api.github.com/repos/laravel/pint/zipball/eac5ec3d6b5c96543c682e309a10fdddc9f61d80", 260 | "reference": "eac5ec3d6b5c96543c682e309a10fdddc9f61d80", 261 | "shasum": "" 262 | }, 263 | "require": { 264 | "ext-json": "*", 265 | "ext-mbstring": "*", 266 | "ext-tokenizer": "*", 267 | "ext-xml": "*", 268 | "php": "^8.1.0" 269 | }, 270 | "require-dev": { 271 | "friendsofphp/php-cs-fixer": "^3.16.0", 272 | "illuminate/view": "^10.5.1", 273 | "laravel-zero/framework": "^10.0.2", 274 | "mockery/mockery": "^1.5.1", 275 | "nunomaduro/larastan": "^2.5.1", 276 | "nunomaduro/termwind": "^1.15.1", 277 | "pestphp/pest": "^2.4.0" 278 | }, 279 | "bin": [ 280 | "builds/pint" 281 | ], 282 | "type": "project", 283 | "autoload": { 284 | "psr-4": { 285 | "App\\": "app/", 286 | "Database\\Seeders\\": "database/seeders/", 287 | "Database\\Factories\\": "database/factories/" 288 | } 289 | }, 290 | "notification-url": "https://packagist.org/downloads/", 291 | "license": [ 292 | "MIT" 293 | ], 294 | "authors": [ 295 | { 296 | "name": "Nuno Maduro", 297 | "email": "enunomaduro@gmail.com" 298 | } 299 | ], 300 | "description": "An opinionated code formatter for PHP.", 301 | "homepage": "https://laravel.com", 302 | "keywords": [ 303 | "format", 304 | "formatter", 305 | "lint", 306 | "linter", 307 | "php" 308 | ], 309 | "support": { 310 | "issues": "https://github.com/laravel/pint/issues", 311 | "source": "https://github.com/laravel/pint" 312 | }, 313 | "time": "2023-04-18T14:50:44+00:00" 314 | }, 315 | { 316 | "name": "myclabs/deep-copy", 317 | "version": "1.11.1", 318 | "source": { 319 | "type": "git", 320 | "url": "https://github.com/myclabs/DeepCopy.git", 321 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" 322 | }, 323 | "dist": { 324 | "type": "zip", 325 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 326 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 327 | "shasum": "" 328 | }, 329 | "require": { 330 | "php": "^7.1 || ^8.0" 331 | }, 332 | "conflict": { 333 | "doctrine/collections": "<1.6.8", 334 | "doctrine/common": "<2.13.3 || >=3,<3.2.2" 335 | }, 336 | "require-dev": { 337 | "doctrine/collections": "^1.6.8", 338 | "doctrine/common": "^2.13.3 || ^3.2.2", 339 | "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" 340 | }, 341 | "type": "library", 342 | "autoload": { 343 | "files": [ 344 | "src/DeepCopy/deep_copy.php" 345 | ], 346 | "psr-4": { 347 | "DeepCopy\\": "src/DeepCopy/" 348 | } 349 | }, 350 | "notification-url": "https://packagist.org/downloads/", 351 | "license": [ 352 | "MIT" 353 | ], 354 | "description": "Create deep copies (clones) of your objects", 355 | "keywords": [ 356 | "clone", 357 | "copy", 358 | "duplicate", 359 | "object", 360 | "object graph" 361 | ], 362 | "support": { 363 | "issues": "https://github.com/myclabs/DeepCopy/issues", 364 | "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" 365 | }, 366 | "funding": [ 367 | { 368 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 369 | "type": "tidelift" 370 | } 371 | ], 372 | "time": "2023-03-08T13:26:56+00:00" 373 | }, 374 | { 375 | "name": "nikic/php-parser", 376 | "version": "v4.15.4", 377 | "source": { 378 | "type": "git", 379 | "url": "https://github.com/nikic/PHP-Parser.git", 380 | "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" 381 | }, 382 | "dist": { 383 | "type": "zip", 384 | "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", 385 | "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", 386 | "shasum": "" 387 | }, 388 | "require": { 389 | "ext-tokenizer": "*", 390 | "php": ">=7.0" 391 | }, 392 | "require-dev": { 393 | "ircmaxell/php-yacc": "^0.0.7", 394 | "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" 395 | }, 396 | "bin": [ 397 | "bin/php-parse" 398 | ], 399 | "type": "library", 400 | "extra": { 401 | "branch-alias": { 402 | "dev-master": "4.9-dev" 403 | } 404 | }, 405 | "autoload": { 406 | "psr-4": { 407 | "PhpParser\\": "lib/PhpParser" 408 | } 409 | }, 410 | "notification-url": "https://packagist.org/downloads/", 411 | "license": [ 412 | "BSD-3-Clause" 413 | ], 414 | "authors": [ 415 | { 416 | "name": "Nikita Popov" 417 | } 418 | ], 419 | "description": "A PHP parser written in PHP", 420 | "keywords": [ 421 | "parser", 422 | "php" 423 | ], 424 | "support": { 425 | "issues": "https://github.com/nikic/PHP-Parser/issues", 426 | "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" 427 | }, 428 | "time": "2023-03-05T19:49:14+00:00" 429 | }, 430 | { 431 | "name": "phar-io/manifest", 432 | "version": "2.0.3", 433 | "source": { 434 | "type": "git", 435 | "url": "https://github.com/phar-io/manifest.git", 436 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53" 437 | }, 438 | "dist": { 439 | "type": "zip", 440 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", 441 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53", 442 | "shasum": "" 443 | }, 444 | "require": { 445 | "ext-dom": "*", 446 | "ext-phar": "*", 447 | "ext-xmlwriter": "*", 448 | "phar-io/version": "^3.0.1", 449 | "php": "^7.2 || ^8.0" 450 | }, 451 | "type": "library", 452 | "extra": { 453 | "branch-alias": { 454 | "dev-master": "2.0.x-dev" 455 | } 456 | }, 457 | "autoload": { 458 | "classmap": [ 459 | "src/" 460 | ] 461 | }, 462 | "notification-url": "https://packagist.org/downloads/", 463 | "license": [ 464 | "BSD-3-Clause" 465 | ], 466 | "authors": [ 467 | { 468 | "name": "Arne Blankerts", 469 | "email": "arne@blankerts.de", 470 | "role": "Developer" 471 | }, 472 | { 473 | "name": "Sebastian Heuer", 474 | "email": "sebastian@phpeople.de", 475 | "role": "Developer" 476 | }, 477 | { 478 | "name": "Sebastian Bergmann", 479 | "email": "sebastian@phpunit.de", 480 | "role": "Developer" 481 | } 482 | ], 483 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 484 | "support": { 485 | "issues": "https://github.com/phar-io/manifest/issues", 486 | "source": "https://github.com/phar-io/manifest/tree/2.0.3" 487 | }, 488 | "time": "2021-07-20T11:28:43+00:00" 489 | }, 490 | { 491 | "name": "phar-io/version", 492 | "version": "3.2.1", 493 | "source": { 494 | "type": "git", 495 | "url": "https://github.com/phar-io/version.git", 496 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" 497 | }, 498 | "dist": { 499 | "type": "zip", 500 | "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 501 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 502 | "shasum": "" 503 | }, 504 | "require": { 505 | "php": "^7.2 || ^8.0" 506 | }, 507 | "type": "library", 508 | "autoload": { 509 | "classmap": [ 510 | "src/" 511 | ] 512 | }, 513 | "notification-url": "https://packagist.org/downloads/", 514 | "license": [ 515 | "BSD-3-Clause" 516 | ], 517 | "authors": [ 518 | { 519 | "name": "Arne Blankerts", 520 | "email": "arne@blankerts.de", 521 | "role": "Developer" 522 | }, 523 | { 524 | "name": "Sebastian Heuer", 525 | "email": "sebastian@phpeople.de", 526 | "role": "Developer" 527 | }, 528 | { 529 | "name": "Sebastian Bergmann", 530 | "email": "sebastian@phpunit.de", 531 | "role": "Developer" 532 | } 533 | ], 534 | "description": "Library for handling version information and constraints", 535 | "support": { 536 | "issues": "https://github.com/phar-io/version/issues", 537 | "source": "https://github.com/phar-io/version/tree/3.2.1" 538 | }, 539 | "time": "2022-02-21T01:04:05+00:00" 540 | }, 541 | { 542 | "name": "phpunit/php-code-coverage", 543 | "version": "10.1.1", 544 | "source": { 545 | "type": "git", 546 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 547 | "reference": "884a0da7f9f46f28b2cb69134217fd810b793974" 548 | }, 549 | "dist": { 550 | "type": "zip", 551 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/884a0da7f9f46f28b2cb69134217fd810b793974", 552 | "reference": "884a0da7f9f46f28b2cb69134217fd810b793974", 553 | "shasum": "" 554 | }, 555 | "require": { 556 | "ext-dom": "*", 557 | "ext-libxml": "*", 558 | "ext-xmlwriter": "*", 559 | "nikic/php-parser": "^4.15", 560 | "php": ">=8.1", 561 | "phpunit/php-file-iterator": "^4.0", 562 | "phpunit/php-text-template": "^3.0", 563 | "sebastian/code-unit-reverse-lookup": "^3.0", 564 | "sebastian/complexity": "^3.0", 565 | "sebastian/environment": "^6.0", 566 | "sebastian/lines-of-code": "^2.0", 567 | "sebastian/version": "^4.0", 568 | "theseer/tokenizer": "^1.2.0" 569 | }, 570 | "require-dev": { 571 | "phpunit/phpunit": "^10.1" 572 | }, 573 | "suggest": { 574 | "ext-pcov": "PHP extension that provides line coverage", 575 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 576 | }, 577 | "type": "library", 578 | "extra": { 579 | "branch-alias": { 580 | "dev-main": "10.1-dev" 581 | } 582 | }, 583 | "autoload": { 584 | "classmap": [ 585 | "src/" 586 | ] 587 | }, 588 | "notification-url": "https://packagist.org/downloads/", 589 | "license": [ 590 | "BSD-3-Clause" 591 | ], 592 | "authors": [ 593 | { 594 | "name": "Sebastian Bergmann", 595 | "email": "sebastian@phpunit.de", 596 | "role": "lead" 597 | } 598 | ], 599 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 600 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 601 | "keywords": [ 602 | "coverage", 603 | "testing", 604 | "xunit" 605 | ], 606 | "support": { 607 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 608 | "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 609 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.1" 610 | }, 611 | "funding": [ 612 | { 613 | "url": "https://github.com/sebastianbergmann", 614 | "type": "github" 615 | } 616 | ], 617 | "time": "2023-04-17T12:15:40+00:00" 618 | }, 619 | { 620 | "name": "phpunit/php-file-iterator", 621 | "version": "4.0.1", 622 | "source": { 623 | "type": "git", 624 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 625 | "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" 626 | }, 627 | "dist": { 628 | "type": "zip", 629 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", 630 | "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", 631 | "shasum": "" 632 | }, 633 | "require": { 634 | "php": ">=8.1" 635 | }, 636 | "require-dev": { 637 | "phpunit/phpunit": "^10.0" 638 | }, 639 | "type": "library", 640 | "extra": { 641 | "branch-alias": { 642 | "dev-main": "4.0-dev" 643 | } 644 | }, 645 | "autoload": { 646 | "classmap": [ 647 | "src/" 648 | ] 649 | }, 650 | "notification-url": "https://packagist.org/downloads/", 651 | "license": [ 652 | "BSD-3-Clause" 653 | ], 654 | "authors": [ 655 | { 656 | "name": "Sebastian Bergmann", 657 | "email": "sebastian@phpunit.de", 658 | "role": "lead" 659 | } 660 | ], 661 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 662 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 663 | "keywords": [ 664 | "filesystem", 665 | "iterator" 666 | ], 667 | "support": { 668 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 669 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" 670 | }, 671 | "funding": [ 672 | { 673 | "url": "https://github.com/sebastianbergmann", 674 | "type": "github" 675 | } 676 | ], 677 | "time": "2023-02-10T16:53:14+00:00" 678 | }, 679 | { 680 | "name": "phpunit/php-invoker", 681 | "version": "4.0.0", 682 | "source": { 683 | "type": "git", 684 | "url": "https://github.com/sebastianbergmann/php-invoker.git", 685 | "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" 686 | }, 687 | "dist": { 688 | "type": "zip", 689 | "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", 690 | "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", 691 | "shasum": "" 692 | }, 693 | "require": { 694 | "php": ">=8.1" 695 | }, 696 | "require-dev": { 697 | "ext-pcntl": "*", 698 | "phpunit/phpunit": "^10.0" 699 | }, 700 | "suggest": { 701 | "ext-pcntl": "*" 702 | }, 703 | "type": "library", 704 | "extra": { 705 | "branch-alias": { 706 | "dev-main": "4.0-dev" 707 | } 708 | }, 709 | "autoload": { 710 | "classmap": [ 711 | "src/" 712 | ] 713 | }, 714 | "notification-url": "https://packagist.org/downloads/", 715 | "license": [ 716 | "BSD-3-Clause" 717 | ], 718 | "authors": [ 719 | { 720 | "name": "Sebastian Bergmann", 721 | "email": "sebastian@phpunit.de", 722 | "role": "lead" 723 | } 724 | ], 725 | "description": "Invoke callables with a timeout", 726 | "homepage": "https://github.com/sebastianbergmann/php-invoker/", 727 | "keywords": [ 728 | "process" 729 | ], 730 | "support": { 731 | "issues": "https://github.com/sebastianbergmann/php-invoker/issues", 732 | "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" 733 | }, 734 | "funding": [ 735 | { 736 | "url": "https://github.com/sebastianbergmann", 737 | "type": "github" 738 | } 739 | ], 740 | "time": "2023-02-03T06:56:09+00:00" 741 | }, 742 | { 743 | "name": "phpunit/php-text-template", 744 | "version": "3.0.0", 745 | "source": { 746 | "type": "git", 747 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 748 | "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" 749 | }, 750 | "dist": { 751 | "type": "zip", 752 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", 753 | "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", 754 | "shasum": "" 755 | }, 756 | "require": { 757 | "php": ">=8.1" 758 | }, 759 | "require-dev": { 760 | "phpunit/phpunit": "^10.0" 761 | }, 762 | "type": "library", 763 | "extra": { 764 | "branch-alias": { 765 | "dev-main": "3.0-dev" 766 | } 767 | }, 768 | "autoload": { 769 | "classmap": [ 770 | "src/" 771 | ] 772 | }, 773 | "notification-url": "https://packagist.org/downloads/", 774 | "license": [ 775 | "BSD-3-Clause" 776 | ], 777 | "authors": [ 778 | { 779 | "name": "Sebastian Bergmann", 780 | "email": "sebastian@phpunit.de", 781 | "role": "lead" 782 | } 783 | ], 784 | "description": "Simple template engine.", 785 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 786 | "keywords": [ 787 | "template" 788 | ], 789 | "support": { 790 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 791 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" 792 | }, 793 | "funding": [ 794 | { 795 | "url": "https://github.com/sebastianbergmann", 796 | "type": "github" 797 | } 798 | ], 799 | "time": "2023-02-03T06:56:46+00:00" 800 | }, 801 | { 802 | "name": "phpunit/php-timer", 803 | "version": "6.0.0", 804 | "source": { 805 | "type": "git", 806 | "url": "https://github.com/sebastianbergmann/php-timer.git", 807 | "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" 808 | }, 809 | "dist": { 810 | "type": "zip", 811 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", 812 | "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", 813 | "shasum": "" 814 | }, 815 | "require": { 816 | "php": ">=8.1" 817 | }, 818 | "require-dev": { 819 | "phpunit/phpunit": "^10.0" 820 | }, 821 | "type": "library", 822 | "extra": { 823 | "branch-alias": { 824 | "dev-main": "6.0-dev" 825 | } 826 | }, 827 | "autoload": { 828 | "classmap": [ 829 | "src/" 830 | ] 831 | }, 832 | "notification-url": "https://packagist.org/downloads/", 833 | "license": [ 834 | "BSD-3-Clause" 835 | ], 836 | "authors": [ 837 | { 838 | "name": "Sebastian Bergmann", 839 | "email": "sebastian@phpunit.de", 840 | "role": "lead" 841 | } 842 | ], 843 | "description": "Utility class for timing", 844 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 845 | "keywords": [ 846 | "timer" 847 | ], 848 | "support": { 849 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 850 | "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" 851 | }, 852 | "funding": [ 853 | { 854 | "url": "https://github.com/sebastianbergmann", 855 | "type": "github" 856 | } 857 | ], 858 | "time": "2023-02-03T06:57:52+00:00" 859 | }, 860 | { 861 | "name": "phpunit/phpunit", 862 | "version": "10.1.2", 863 | "source": { 864 | "type": "git", 865 | "url": "https://github.com/sebastianbergmann/phpunit.git", 866 | "reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b" 867 | }, 868 | "dist": { 869 | "type": "zip", 870 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6f0cd95be71add539f8fd2be25b2a4a29789000b", 871 | "reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b", 872 | "shasum": "" 873 | }, 874 | "require": { 875 | "ext-dom": "*", 876 | "ext-json": "*", 877 | "ext-libxml": "*", 878 | "ext-mbstring": "*", 879 | "ext-xml": "*", 880 | "ext-xmlwriter": "*", 881 | "myclabs/deep-copy": "^1.10.1", 882 | "phar-io/manifest": "^2.0.3", 883 | "phar-io/version": "^3.0.2", 884 | "php": ">=8.1", 885 | "phpunit/php-code-coverage": "^10.1.1", 886 | "phpunit/php-file-iterator": "^4.0", 887 | "phpunit/php-invoker": "^4.0", 888 | "phpunit/php-text-template": "^3.0", 889 | "phpunit/php-timer": "^6.0", 890 | "sebastian/cli-parser": "^2.0", 891 | "sebastian/code-unit": "^2.0", 892 | "sebastian/comparator": "^5.0", 893 | "sebastian/diff": "^5.0", 894 | "sebastian/environment": "^6.0", 895 | "sebastian/exporter": "^5.0", 896 | "sebastian/global-state": "^6.0", 897 | "sebastian/object-enumerator": "^5.0", 898 | "sebastian/recursion-context": "^5.0", 899 | "sebastian/type": "^4.0", 900 | "sebastian/version": "^4.0" 901 | }, 902 | "suggest": { 903 | "ext-soap": "To be able to generate mocks based on WSDL files" 904 | }, 905 | "bin": [ 906 | "phpunit" 907 | ], 908 | "type": "library", 909 | "extra": { 910 | "branch-alias": { 911 | "dev-main": "10.1-dev" 912 | } 913 | }, 914 | "autoload": { 915 | "files": [ 916 | "src/Framework/Assert/Functions.php" 917 | ], 918 | "classmap": [ 919 | "src/" 920 | ] 921 | }, 922 | "notification-url": "https://packagist.org/downloads/", 923 | "license": [ 924 | "BSD-3-Clause" 925 | ], 926 | "authors": [ 927 | { 928 | "name": "Sebastian Bergmann", 929 | "email": "sebastian@phpunit.de", 930 | "role": "lead" 931 | } 932 | ], 933 | "description": "The PHP Unit Testing framework.", 934 | "homepage": "https://phpunit.de/", 935 | "keywords": [ 936 | "phpunit", 937 | "testing", 938 | "xunit" 939 | ], 940 | "support": { 941 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 942 | "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 943 | "source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.2" 944 | }, 945 | "funding": [ 946 | { 947 | "url": "https://phpunit.de/sponsors.html", 948 | "type": "custom" 949 | }, 950 | { 951 | "url": "https://github.com/sebastianbergmann", 952 | "type": "github" 953 | }, 954 | { 955 | "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", 956 | "type": "tidelift" 957 | } 958 | ], 959 | "time": "2023-04-22T07:38:19+00:00" 960 | }, 961 | { 962 | "name": "sebastian/cli-parser", 963 | "version": "2.0.0", 964 | "source": { 965 | "type": "git", 966 | "url": "https://github.com/sebastianbergmann/cli-parser.git", 967 | "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" 968 | }, 969 | "dist": { 970 | "type": "zip", 971 | "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", 972 | "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", 973 | "shasum": "" 974 | }, 975 | "require": { 976 | "php": ">=8.1" 977 | }, 978 | "require-dev": { 979 | "phpunit/phpunit": "^10.0" 980 | }, 981 | "type": "library", 982 | "extra": { 983 | "branch-alias": { 984 | "dev-main": "2.0-dev" 985 | } 986 | }, 987 | "autoload": { 988 | "classmap": [ 989 | "src/" 990 | ] 991 | }, 992 | "notification-url": "https://packagist.org/downloads/", 993 | "license": [ 994 | "BSD-3-Clause" 995 | ], 996 | "authors": [ 997 | { 998 | "name": "Sebastian Bergmann", 999 | "email": "sebastian@phpunit.de", 1000 | "role": "lead" 1001 | } 1002 | ], 1003 | "description": "Library for parsing CLI options", 1004 | "homepage": "https://github.com/sebastianbergmann/cli-parser", 1005 | "support": { 1006 | "issues": "https://github.com/sebastianbergmann/cli-parser/issues", 1007 | "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" 1008 | }, 1009 | "funding": [ 1010 | { 1011 | "url": "https://github.com/sebastianbergmann", 1012 | "type": "github" 1013 | } 1014 | ], 1015 | "time": "2023-02-03T06:58:15+00:00" 1016 | }, 1017 | { 1018 | "name": "sebastian/code-unit", 1019 | "version": "2.0.0", 1020 | "source": { 1021 | "type": "git", 1022 | "url": "https://github.com/sebastianbergmann/code-unit.git", 1023 | "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" 1024 | }, 1025 | "dist": { 1026 | "type": "zip", 1027 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", 1028 | "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", 1029 | "shasum": "" 1030 | }, 1031 | "require": { 1032 | "php": ">=8.1" 1033 | }, 1034 | "require-dev": { 1035 | "phpunit/phpunit": "^10.0" 1036 | }, 1037 | "type": "library", 1038 | "extra": { 1039 | "branch-alias": { 1040 | "dev-main": "2.0-dev" 1041 | } 1042 | }, 1043 | "autoload": { 1044 | "classmap": [ 1045 | "src/" 1046 | ] 1047 | }, 1048 | "notification-url": "https://packagist.org/downloads/", 1049 | "license": [ 1050 | "BSD-3-Clause" 1051 | ], 1052 | "authors": [ 1053 | { 1054 | "name": "Sebastian Bergmann", 1055 | "email": "sebastian@phpunit.de", 1056 | "role": "lead" 1057 | } 1058 | ], 1059 | "description": "Collection of value objects that represent the PHP code units", 1060 | "homepage": "https://github.com/sebastianbergmann/code-unit", 1061 | "support": { 1062 | "issues": "https://github.com/sebastianbergmann/code-unit/issues", 1063 | "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" 1064 | }, 1065 | "funding": [ 1066 | { 1067 | "url": "https://github.com/sebastianbergmann", 1068 | "type": "github" 1069 | } 1070 | ], 1071 | "time": "2023-02-03T06:58:43+00:00" 1072 | }, 1073 | { 1074 | "name": "sebastian/code-unit-reverse-lookup", 1075 | "version": "3.0.0", 1076 | "source": { 1077 | "type": "git", 1078 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1079 | "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" 1080 | }, 1081 | "dist": { 1082 | "type": "zip", 1083 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", 1084 | "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", 1085 | "shasum": "" 1086 | }, 1087 | "require": { 1088 | "php": ">=8.1" 1089 | }, 1090 | "require-dev": { 1091 | "phpunit/phpunit": "^10.0" 1092 | }, 1093 | "type": "library", 1094 | "extra": { 1095 | "branch-alias": { 1096 | "dev-main": "3.0-dev" 1097 | } 1098 | }, 1099 | "autoload": { 1100 | "classmap": [ 1101 | "src/" 1102 | ] 1103 | }, 1104 | "notification-url": "https://packagist.org/downloads/", 1105 | "license": [ 1106 | "BSD-3-Clause" 1107 | ], 1108 | "authors": [ 1109 | { 1110 | "name": "Sebastian Bergmann", 1111 | "email": "sebastian@phpunit.de" 1112 | } 1113 | ], 1114 | "description": "Looks up which function or method a line of code belongs to", 1115 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1116 | "support": { 1117 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 1118 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" 1119 | }, 1120 | "funding": [ 1121 | { 1122 | "url": "https://github.com/sebastianbergmann", 1123 | "type": "github" 1124 | } 1125 | ], 1126 | "time": "2023-02-03T06:59:15+00:00" 1127 | }, 1128 | { 1129 | "name": "sebastian/comparator", 1130 | "version": "5.0.0", 1131 | "source": { 1132 | "type": "git", 1133 | "url": "https://github.com/sebastianbergmann/comparator.git", 1134 | "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" 1135 | }, 1136 | "dist": { 1137 | "type": "zip", 1138 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", 1139 | "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", 1140 | "shasum": "" 1141 | }, 1142 | "require": { 1143 | "ext-dom": "*", 1144 | "ext-mbstring": "*", 1145 | "php": ">=8.1", 1146 | "sebastian/diff": "^5.0", 1147 | "sebastian/exporter": "^5.0" 1148 | }, 1149 | "require-dev": { 1150 | "phpunit/phpunit": "^10.0" 1151 | }, 1152 | "type": "library", 1153 | "extra": { 1154 | "branch-alias": { 1155 | "dev-main": "5.0-dev" 1156 | } 1157 | }, 1158 | "autoload": { 1159 | "classmap": [ 1160 | "src/" 1161 | ] 1162 | }, 1163 | "notification-url": "https://packagist.org/downloads/", 1164 | "license": [ 1165 | "BSD-3-Clause" 1166 | ], 1167 | "authors": [ 1168 | { 1169 | "name": "Sebastian Bergmann", 1170 | "email": "sebastian@phpunit.de" 1171 | }, 1172 | { 1173 | "name": "Jeff Welch", 1174 | "email": "whatthejeff@gmail.com" 1175 | }, 1176 | { 1177 | "name": "Volker Dusch", 1178 | "email": "github@wallbash.com" 1179 | }, 1180 | { 1181 | "name": "Bernhard Schussek", 1182 | "email": "bschussek@2bepublished.at" 1183 | } 1184 | ], 1185 | "description": "Provides the functionality to compare PHP values for equality", 1186 | "homepage": "https://github.com/sebastianbergmann/comparator", 1187 | "keywords": [ 1188 | "comparator", 1189 | "compare", 1190 | "equality" 1191 | ], 1192 | "support": { 1193 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 1194 | "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" 1195 | }, 1196 | "funding": [ 1197 | { 1198 | "url": "https://github.com/sebastianbergmann", 1199 | "type": "github" 1200 | } 1201 | ], 1202 | "time": "2023-02-03T07:07:16+00:00" 1203 | }, 1204 | { 1205 | "name": "sebastian/complexity", 1206 | "version": "3.0.0", 1207 | "source": { 1208 | "type": "git", 1209 | "url": "https://github.com/sebastianbergmann/complexity.git", 1210 | "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" 1211 | }, 1212 | "dist": { 1213 | "type": "zip", 1214 | "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", 1215 | "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", 1216 | "shasum": "" 1217 | }, 1218 | "require": { 1219 | "nikic/php-parser": "^4.10", 1220 | "php": ">=8.1" 1221 | }, 1222 | "require-dev": { 1223 | "phpunit/phpunit": "^10.0" 1224 | }, 1225 | "type": "library", 1226 | "extra": { 1227 | "branch-alias": { 1228 | "dev-main": "3.0-dev" 1229 | } 1230 | }, 1231 | "autoload": { 1232 | "classmap": [ 1233 | "src/" 1234 | ] 1235 | }, 1236 | "notification-url": "https://packagist.org/downloads/", 1237 | "license": [ 1238 | "BSD-3-Clause" 1239 | ], 1240 | "authors": [ 1241 | { 1242 | "name": "Sebastian Bergmann", 1243 | "email": "sebastian@phpunit.de", 1244 | "role": "lead" 1245 | } 1246 | ], 1247 | "description": "Library for calculating the complexity of PHP code units", 1248 | "homepage": "https://github.com/sebastianbergmann/complexity", 1249 | "support": { 1250 | "issues": "https://github.com/sebastianbergmann/complexity/issues", 1251 | "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" 1252 | }, 1253 | "funding": [ 1254 | { 1255 | "url": "https://github.com/sebastianbergmann", 1256 | "type": "github" 1257 | } 1258 | ], 1259 | "time": "2023-02-03T06:59:47+00:00" 1260 | }, 1261 | { 1262 | "name": "sebastian/diff", 1263 | "version": "5.0.1", 1264 | "source": { 1265 | "type": "git", 1266 | "url": "https://github.com/sebastianbergmann/diff.git", 1267 | "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" 1268 | }, 1269 | "dist": { 1270 | "type": "zip", 1271 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", 1272 | "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", 1273 | "shasum": "" 1274 | }, 1275 | "require": { 1276 | "php": ">=8.1" 1277 | }, 1278 | "require-dev": { 1279 | "phpunit/phpunit": "^10.0", 1280 | "symfony/process": "^4.2 || ^5" 1281 | }, 1282 | "type": "library", 1283 | "extra": { 1284 | "branch-alias": { 1285 | "dev-main": "5.0-dev" 1286 | } 1287 | }, 1288 | "autoload": { 1289 | "classmap": [ 1290 | "src/" 1291 | ] 1292 | }, 1293 | "notification-url": "https://packagist.org/downloads/", 1294 | "license": [ 1295 | "BSD-3-Clause" 1296 | ], 1297 | "authors": [ 1298 | { 1299 | "name": "Sebastian Bergmann", 1300 | "email": "sebastian@phpunit.de" 1301 | }, 1302 | { 1303 | "name": "Kore Nordmann", 1304 | "email": "mail@kore-nordmann.de" 1305 | } 1306 | ], 1307 | "description": "Diff implementation", 1308 | "homepage": "https://github.com/sebastianbergmann/diff", 1309 | "keywords": [ 1310 | "diff", 1311 | "udiff", 1312 | "unidiff", 1313 | "unified diff" 1314 | ], 1315 | "support": { 1316 | "issues": "https://github.com/sebastianbergmann/diff/issues", 1317 | "security": "https://github.com/sebastianbergmann/diff/security/policy", 1318 | "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" 1319 | }, 1320 | "funding": [ 1321 | { 1322 | "url": "https://github.com/sebastianbergmann", 1323 | "type": "github" 1324 | } 1325 | ], 1326 | "time": "2023-03-23T05:12:41+00:00" 1327 | }, 1328 | { 1329 | "name": "sebastian/environment", 1330 | "version": "6.0.1", 1331 | "source": { 1332 | "type": "git", 1333 | "url": "https://github.com/sebastianbergmann/environment.git", 1334 | "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" 1335 | }, 1336 | "dist": { 1337 | "type": "zip", 1338 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", 1339 | "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", 1340 | "shasum": "" 1341 | }, 1342 | "require": { 1343 | "php": ">=8.1" 1344 | }, 1345 | "require-dev": { 1346 | "phpunit/phpunit": "^10.0" 1347 | }, 1348 | "suggest": { 1349 | "ext-posix": "*" 1350 | }, 1351 | "type": "library", 1352 | "extra": { 1353 | "branch-alias": { 1354 | "dev-main": "6.0-dev" 1355 | } 1356 | }, 1357 | "autoload": { 1358 | "classmap": [ 1359 | "src/" 1360 | ] 1361 | }, 1362 | "notification-url": "https://packagist.org/downloads/", 1363 | "license": [ 1364 | "BSD-3-Clause" 1365 | ], 1366 | "authors": [ 1367 | { 1368 | "name": "Sebastian Bergmann", 1369 | "email": "sebastian@phpunit.de" 1370 | } 1371 | ], 1372 | "description": "Provides functionality to handle HHVM/PHP environments", 1373 | "homepage": "https://github.com/sebastianbergmann/environment", 1374 | "keywords": [ 1375 | "Xdebug", 1376 | "environment", 1377 | "hhvm" 1378 | ], 1379 | "support": { 1380 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1381 | "security": "https://github.com/sebastianbergmann/environment/security/policy", 1382 | "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" 1383 | }, 1384 | "funding": [ 1385 | { 1386 | "url": "https://github.com/sebastianbergmann", 1387 | "type": "github" 1388 | } 1389 | ], 1390 | "time": "2023-04-11T05:39:26+00:00" 1391 | }, 1392 | { 1393 | "name": "sebastian/exporter", 1394 | "version": "5.0.0", 1395 | "source": { 1396 | "type": "git", 1397 | "url": "https://github.com/sebastianbergmann/exporter.git", 1398 | "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" 1399 | }, 1400 | "dist": { 1401 | "type": "zip", 1402 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", 1403 | "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", 1404 | "shasum": "" 1405 | }, 1406 | "require": { 1407 | "ext-mbstring": "*", 1408 | "php": ">=8.1", 1409 | "sebastian/recursion-context": "^5.0" 1410 | }, 1411 | "require-dev": { 1412 | "phpunit/phpunit": "^10.0" 1413 | }, 1414 | "type": "library", 1415 | "extra": { 1416 | "branch-alias": { 1417 | "dev-main": "5.0-dev" 1418 | } 1419 | }, 1420 | "autoload": { 1421 | "classmap": [ 1422 | "src/" 1423 | ] 1424 | }, 1425 | "notification-url": "https://packagist.org/downloads/", 1426 | "license": [ 1427 | "BSD-3-Clause" 1428 | ], 1429 | "authors": [ 1430 | { 1431 | "name": "Sebastian Bergmann", 1432 | "email": "sebastian@phpunit.de" 1433 | }, 1434 | { 1435 | "name": "Jeff Welch", 1436 | "email": "whatthejeff@gmail.com" 1437 | }, 1438 | { 1439 | "name": "Volker Dusch", 1440 | "email": "github@wallbash.com" 1441 | }, 1442 | { 1443 | "name": "Adam Harvey", 1444 | "email": "aharvey@php.net" 1445 | }, 1446 | { 1447 | "name": "Bernhard Schussek", 1448 | "email": "bschussek@gmail.com" 1449 | } 1450 | ], 1451 | "description": "Provides the functionality to export PHP variables for visualization", 1452 | "homepage": "https://www.github.com/sebastianbergmann/exporter", 1453 | "keywords": [ 1454 | "export", 1455 | "exporter" 1456 | ], 1457 | "support": { 1458 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1459 | "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" 1460 | }, 1461 | "funding": [ 1462 | { 1463 | "url": "https://github.com/sebastianbergmann", 1464 | "type": "github" 1465 | } 1466 | ], 1467 | "time": "2023-02-03T07:06:49+00:00" 1468 | }, 1469 | { 1470 | "name": "sebastian/global-state", 1471 | "version": "6.0.0", 1472 | "source": { 1473 | "type": "git", 1474 | "url": "https://github.com/sebastianbergmann/global-state.git", 1475 | "reference": "aab257c712de87b90194febd52e4d184551c2d44" 1476 | }, 1477 | "dist": { 1478 | "type": "zip", 1479 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", 1480 | "reference": "aab257c712de87b90194febd52e4d184551c2d44", 1481 | "shasum": "" 1482 | }, 1483 | "require": { 1484 | "php": ">=8.1", 1485 | "sebastian/object-reflector": "^3.0", 1486 | "sebastian/recursion-context": "^5.0" 1487 | }, 1488 | "require-dev": { 1489 | "ext-dom": "*", 1490 | "phpunit/phpunit": "^10.0" 1491 | }, 1492 | "type": "library", 1493 | "extra": { 1494 | "branch-alias": { 1495 | "dev-main": "6.0-dev" 1496 | } 1497 | }, 1498 | "autoload": { 1499 | "classmap": [ 1500 | "src/" 1501 | ] 1502 | }, 1503 | "notification-url": "https://packagist.org/downloads/", 1504 | "license": [ 1505 | "BSD-3-Clause" 1506 | ], 1507 | "authors": [ 1508 | { 1509 | "name": "Sebastian Bergmann", 1510 | "email": "sebastian@phpunit.de" 1511 | } 1512 | ], 1513 | "description": "Snapshotting of global state", 1514 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1515 | "keywords": [ 1516 | "global state" 1517 | ], 1518 | "support": { 1519 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1520 | "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" 1521 | }, 1522 | "funding": [ 1523 | { 1524 | "url": "https://github.com/sebastianbergmann", 1525 | "type": "github" 1526 | } 1527 | ], 1528 | "time": "2023-02-03T07:07:38+00:00" 1529 | }, 1530 | { 1531 | "name": "sebastian/lines-of-code", 1532 | "version": "2.0.0", 1533 | "source": { 1534 | "type": "git", 1535 | "url": "https://github.com/sebastianbergmann/lines-of-code.git", 1536 | "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" 1537 | }, 1538 | "dist": { 1539 | "type": "zip", 1540 | "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", 1541 | "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", 1542 | "shasum": "" 1543 | }, 1544 | "require": { 1545 | "nikic/php-parser": "^4.10", 1546 | "php": ">=8.1" 1547 | }, 1548 | "require-dev": { 1549 | "phpunit/phpunit": "^10.0" 1550 | }, 1551 | "type": "library", 1552 | "extra": { 1553 | "branch-alias": { 1554 | "dev-main": "2.0-dev" 1555 | } 1556 | }, 1557 | "autoload": { 1558 | "classmap": [ 1559 | "src/" 1560 | ] 1561 | }, 1562 | "notification-url": "https://packagist.org/downloads/", 1563 | "license": [ 1564 | "BSD-3-Clause" 1565 | ], 1566 | "authors": [ 1567 | { 1568 | "name": "Sebastian Bergmann", 1569 | "email": "sebastian@phpunit.de", 1570 | "role": "lead" 1571 | } 1572 | ], 1573 | "description": "Library for counting the lines of code in PHP source code", 1574 | "homepage": "https://github.com/sebastianbergmann/lines-of-code", 1575 | "support": { 1576 | "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", 1577 | "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" 1578 | }, 1579 | "funding": [ 1580 | { 1581 | "url": "https://github.com/sebastianbergmann", 1582 | "type": "github" 1583 | } 1584 | ], 1585 | "time": "2023-02-03T07:08:02+00:00" 1586 | }, 1587 | { 1588 | "name": "sebastian/object-enumerator", 1589 | "version": "5.0.0", 1590 | "source": { 1591 | "type": "git", 1592 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1593 | "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" 1594 | }, 1595 | "dist": { 1596 | "type": "zip", 1597 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", 1598 | "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", 1599 | "shasum": "" 1600 | }, 1601 | "require": { 1602 | "php": ">=8.1", 1603 | "sebastian/object-reflector": "^3.0", 1604 | "sebastian/recursion-context": "^5.0" 1605 | }, 1606 | "require-dev": { 1607 | "phpunit/phpunit": "^10.0" 1608 | }, 1609 | "type": "library", 1610 | "extra": { 1611 | "branch-alias": { 1612 | "dev-main": "5.0-dev" 1613 | } 1614 | }, 1615 | "autoload": { 1616 | "classmap": [ 1617 | "src/" 1618 | ] 1619 | }, 1620 | "notification-url": "https://packagist.org/downloads/", 1621 | "license": [ 1622 | "BSD-3-Clause" 1623 | ], 1624 | "authors": [ 1625 | { 1626 | "name": "Sebastian Bergmann", 1627 | "email": "sebastian@phpunit.de" 1628 | } 1629 | ], 1630 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1631 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1632 | "support": { 1633 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1634 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" 1635 | }, 1636 | "funding": [ 1637 | { 1638 | "url": "https://github.com/sebastianbergmann", 1639 | "type": "github" 1640 | } 1641 | ], 1642 | "time": "2023-02-03T07:08:32+00:00" 1643 | }, 1644 | { 1645 | "name": "sebastian/object-reflector", 1646 | "version": "3.0.0", 1647 | "source": { 1648 | "type": "git", 1649 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1650 | "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" 1651 | }, 1652 | "dist": { 1653 | "type": "zip", 1654 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", 1655 | "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", 1656 | "shasum": "" 1657 | }, 1658 | "require": { 1659 | "php": ">=8.1" 1660 | }, 1661 | "require-dev": { 1662 | "phpunit/phpunit": "^10.0" 1663 | }, 1664 | "type": "library", 1665 | "extra": { 1666 | "branch-alias": { 1667 | "dev-main": "3.0-dev" 1668 | } 1669 | }, 1670 | "autoload": { 1671 | "classmap": [ 1672 | "src/" 1673 | ] 1674 | }, 1675 | "notification-url": "https://packagist.org/downloads/", 1676 | "license": [ 1677 | "BSD-3-Clause" 1678 | ], 1679 | "authors": [ 1680 | { 1681 | "name": "Sebastian Bergmann", 1682 | "email": "sebastian@phpunit.de" 1683 | } 1684 | ], 1685 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1686 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1687 | "support": { 1688 | "issues": "https://github.com/sebastianbergmann/object-reflector/issues", 1689 | "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" 1690 | }, 1691 | "funding": [ 1692 | { 1693 | "url": "https://github.com/sebastianbergmann", 1694 | "type": "github" 1695 | } 1696 | ], 1697 | "time": "2023-02-03T07:06:18+00:00" 1698 | }, 1699 | { 1700 | "name": "sebastian/recursion-context", 1701 | "version": "5.0.0", 1702 | "source": { 1703 | "type": "git", 1704 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1705 | "reference": "05909fb5bc7df4c52992396d0116aed689f93712" 1706 | }, 1707 | "dist": { 1708 | "type": "zip", 1709 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", 1710 | "reference": "05909fb5bc7df4c52992396d0116aed689f93712", 1711 | "shasum": "" 1712 | }, 1713 | "require": { 1714 | "php": ">=8.1" 1715 | }, 1716 | "require-dev": { 1717 | "phpunit/phpunit": "^10.0" 1718 | }, 1719 | "type": "library", 1720 | "extra": { 1721 | "branch-alias": { 1722 | "dev-main": "5.0-dev" 1723 | } 1724 | }, 1725 | "autoload": { 1726 | "classmap": [ 1727 | "src/" 1728 | ] 1729 | }, 1730 | "notification-url": "https://packagist.org/downloads/", 1731 | "license": [ 1732 | "BSD-3-Clause" 1733 | ], 1734 | "authors": [ 1735 | { 1736 | "name": "Sebastian Bergmann", 1737 | "email": "sebastian@phpunit.de" 1738 | }, 1739 | { 1740 | "name": "Jeff Welch", 1741 | "email": "whatthejeff@gmail.com" 1742 | }, 1743 | { 1744 | "name": "Adam Harvey", 1745 | "email": "aharvey@php.net" 1746 | } 1747 | ], 1748 | "description": "Provides functionality to recursively process PHP variables", 1749 | "homepage": "https://github.com/sebastianbergmann/recursion-context", 1750 | "support": { 1751 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1752 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" 1753 | }, 1754 | "funding": [ 1755 | { 1756 | "url": "https://github.com/sebastianbergmann", 1757 | "type": "github" 1758 | } 1759 | ], 1760 | "time": "2023-02-03T07:05:40+00:00" 1761 | }, 1762 | { 1763 | "name": "sebastian/type", 1764 | "version": "4.0.0", 1765 | "source": { 1766 | "type": "git", 1767 | "url": "https://github.com/sebastianbergmann/type.git", 1768 | "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" 1769 | }, 1770 | "dist": { 1771 | "type": "zip", 1772 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", 1773 | "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", 1774 | "shasum": "" 1775 | }, 1776 | "require": { 1777 | "php": ">=8.1" 1778 | }, 1779 | "require-dev": { 1780 | "phpunit/phpunit": "^10.0" 1781 | }, 1782 | "type": "library", 1783 | "extra": { 1784 | "branch-alias": { 1785 | "dev-main": "4.0-dev" 1786 | } 1787 | }, 1788 | "autoload": { 1789 | "classmap": [ 1790 | "src/" 1791 | ] 1792 | }, 1793 | "notification-url": "https://packagist.org/downloads/", 1794 | "license": [ 1795 | "BSD-3-Clause" 1796 | ], 1797 | "authors": [ 1798 | { 1799 | "name": "Sebastian Bergmann", 1800 | "email": "sebastian@phpunit.de", 1801 | "role": "lead" 1802 | } 1803 | ], 1804 | "description": "Collection of value objects that represent the types of the PHP type system", 1805 | "homepage": "https://github.com/sebastianbergmann/type", 1806 | "support": { 1807 | "issues": "https://github.com/sebastianbergmann/type/issues", 1808 | "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" 1809 | }, 1810 | "funding": [ 1811 | { 1812 | "url": "https://github.com/sebastianbergmann", 1813 | "type": "github" 1814 | } 1815 | ], 1816 | "time": "2023-02-03T07:10:45+00:00" 1817 | }, 1818 | { 1819 | "name": "sebastian/version", 1820 | "version": "4.0.1", 1821 | "source": { 1822 | "type": "git", 1823 | "url": "https://github.com/sebastianbergmann/version.git", 1824 | "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" 1825 | }, 1826 | "dist": { 1827 | "type": "zip", 1828 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", 1829 | "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", 1830 | "shasum": "" 1831 | }, 1832 | "require": { 1833 | "php": ">=8.1" 1834 | }, 1835 | "type": "library", 1836 | "extra": { 1837 | "branch-alias": { 1838 | "dev-main": "4.0-dev" 1839 | } 1840 | }, 1841 | "autoload": { 1842 | "classmap": [ 1843 | "src/" 1844 | ] 1845 | }, 1846 | "notification-url": "https://packagist.org/downloads/", 1847 | "license": [ 1848 | "BSD-3-Clause" 1849 | ], 1850 | "authors": [ 1851 | { 1852 | "name": "Sebastian Bergmann", 1853 | "email": "sebastian@phpunit.de", 1854 | "role": "lead" 1855 | } 1856 | ], 1857 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1858 | "homepage": "https://github.com/sebastianbergmann/version", 1859 | "support": { 1860 | "issues": "https://github.com/sebastianbergmann/version/issues", 1861 | "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" 1862 | }, 1863 | "funding": [ 1864 | { 1865 | "url": "https://github.com/sebastianbergmann", 1866 | "type": "github" 1867 | } 1868 | ], 1869 | "time": "2023-02-07T11:34:05+00:00" 1870 | }, 1871 | { 1872 | "name": "theseer/tokenizer", 1873 | "version": "1.2.1", 1874 | "source": { 1875 | "type": "git", 1876 | "url": "https://github.com/theseer/tokenizer.git", 1877 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" 1878 | }, 1879 | "dist": { 1880 | "type": "zip", 1881 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", 1882 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", 1883 | "shasum": "" 1884 | }, 1885 | "require": { 1886 | "ext-dom": "*", 1887 | "ext-tokenizer": "*", 1888 | "ext-xmlwriter": "*", 1889 | "php": "^7.2 || ^8.0" 1890 | }, 1891 | "type": "library", 1892 | "autoload": { 1893 | "classmap": [ 1894 | "src/" 1895 | ] 1896 | }, 1897 | "notification-url": "https://packagist.org/downloads/", 1898 | "license": [ 1899 | "BSD-3-Clause" 1900 | ], 1901 | "authors": [ 1902 | { 1903 | "name": "Arne Blankerts", 1904 | "email": "arne@blankerts.de", 1905 | "role": "Developer" 1906 | } 1907 | ], 1908 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1909 | "support": { 1910 | "issues": "https://github.com/theseer/tokenizer/issues", 1911 | "source": "https://github.com/theseer/tokenizer/tree/1.2.1" 1912 | }, 1913 | "funding": [ 1914 | { 1915 | "url": "https://github.com/theseer", 1916 | "type": "github" 1917 | } 1918 | ], 1919 | "time": "2021-07-28T10:34:58+00:00" 1920 | } 1921 | ], 1922 | "aliases": [], 1923 | "minimum-stability": "dev", 1924 | "stability-flags": [], 1925 | "prefer-stable": true, 1926 | "prefer-lowest": false, 1927 | "platform": { 1928 | "php": ">=7.4" 1929 | }, 1930 | "platform-dev": [], 1931 | "plugin-api-version": "2.3.0" 1932 | } 1933 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | **Few additional assertions for testing Laravel views.** 2 | 3 | # Why 4 | 5 | Laravel has well established and documented way of testing requests. However, this is not the case for the views. I always felt that views in Laravel are neglected when it comes to testing, however being confident that form, submit button, and input fields are present is essential. 6 | 7 | Granted, you can use Dusk, but it is significantly slower than regular feature tests and adding Dusk as part of the test suite is not always desired. 8 | 9 | That's why I created this package. It is my attempt/proposal for adding a bit of TDD concept to the views too. Hope you like it. 10 | 11 | # Installation 12 | 13 | ```bash 14 | composer require --dev jcergolj/laravel-view-test-assertions 15 | ``` 16 | 17 | # Assertions 18 | 19 | `assertViewHasForm(string $selector = null, string $method = null, string $action = null)` 20 | 21 |
22 | 23 | > **This assertion should alway be called first. Based on selector form is selected. By default first form is selected.** 24 | 25 | `assertFormHasCSRF()` 26 | 27 | `assertFormHasSubmitButton(string $name = null, string $value = null)` 28 | 29 | `assertFormHasTextInput(string $name = null, string $value)` 30 | 31 | `assertFormHasButtonInput($type = 'submit', string $name = null, string $value)` 32 | 33 | `assertFormHasColorInput(string $name = null, string $value)` 34 | 35 | `assertFormHasDateInput(string $name = null, string $value)` 36 | 37 | `assertFormHasDateLocalInput(string $name = null, string $value)` 38 | 39 | `assertFormHasEmailInput(string $name = null, string $value)` 40 | 41 | `assertFormHasFileInput(string $name = null, string $value)` 42 | 43 | `assertFormHasHiddenInput(string $name = null, string $value)` 44 | 45 | `assertFormHasImageInput(string $name = null, string $value)` 46 | 47 | `assertFormHasMonthInput(string $name = null, string $value)` 48 | 49 | `assertFormHasNumberInput(string $name = null, string $value)` 50 | 51 | `assertFormHasPasswordInput(string $name = null, string $value)` 52 | 53 | `assertFormHasRangeInput(string $name = null, string $value)` 54 | 55 | `assertFormHasResetInput(string $name = null, string $value)` 56 | 57 | `assertFormHasSearchInput(string $name = null, string $value)` 58 | 59 | `assertFormHasTelInput(string $name = null, string $value)` 60 | 61 | `assertFormHasTextInput(string $name = null, string $value)` 62 | 63 | `assertFormHasUrlInput(string $name = null, string $value)` 64 | 65 | `assertFormHasWeekInput(string $name = null, string $value)` 66 | 67 | `assertFormHasDropdown(string $name = null)` 68 | 69 | `assertFormHasCheckboxInput(string $name = null, string $value = null)` 70 | 71 | `assertFormHasRadioInput(string $name, string $value = null)` 72 | 73 | `assertElementHasChild(string $parentSelector, string $childSelector)` 74 | 75 | `assertFieldHasValidationErrorMsg(string $errorMsg)` 76 | 77 | `assertFormHasField($type, $name, $value = null)` 78 | 79 | `assertFormHasField(string $type, string $name, string $value = null)` 80 | 81 | `assertElementHasChild(string $parentSelector, string $childSelector)` 82 | 83 | `assertFieldHasValidationErrorMsg(string $errorMsg)` 84 | 85 | # Example 86 | 87 | ## View 88 | 89 | ```html 90 | // resources/welcome.blade.php 91 | 92 | 93 | 94 | 95 | 96 | 97 | Laravel 98 | 99 | 100 | 101 |
102 |

Form

103 | 104 | @csrf 105 | 106 |
The First Name must only contain letters.
107 | 108 | 111 | 112 | 113 |
114 | 115 |
116 |
117 |
118 | 119 |
120 | 121 |
122 | 123 | 124 | 125 | ``` 126 | 127 | ## Example Test 128 | ```php 129 | get('/'); 145 | 146 | $response->assertStatus(200) 147 | ->assertViewHasForm() // first form is selected by default 148 | ->assertViewHasForm(null, 'post', '/users') 149 | ->assertFormHasField('text', 'first_name') 150 | ->assertFormHasRadioInput('gender') 151 | ->assertFormHasRadioInput('gender', 'male') 152 | ->assertFormHasCSRF() 153 | ->assertFormHasSubmitButton() 154 | ->assertFieldHasValidationErrorMsg(trans('validation.alpha', ['attribute' => 'First Name'])) 155 | ->assertFormHasField('select', 'age') 156 | ->assertFormHasDropdown('age') 157 | ->assertFormHasCheckboxInput('confirm') 158 | ->assertFormHasCheckboxInput('confirm', 1) 159 | ->assertElementHasChild('select[name="age"]', 'option[value="5"]') 160 | ->assertElementHasChild('select[name="age"]', 'option:contains("5 Years")') 161 | ->assertElementHasChild('div#parent', 'div.child') 162 | ->selectFormElement('id="second"') 163 | ->assertViewHasForm(null, '/post') 164 | ->assertFormHasTextInput('title'); 165 | 166 | // if multiple forms are presented on the page, personally would split assertions; 167 | $response->assertViewHasForm('id="second"') 168 | ->assertFormHasTextInput('title[]'); 169 | } 170 | } 171 | ``` 172 | -------------------------------------------------------------------------------- /src/LaravelViewTestAssertionsServiceProvider.php: -------------------------------------------------------------------------------- 1 | view($view, $data) 21 | ); 22 | }; 23 | } 24 | 25 | public function assertViewHasForm() 26 | { 27 | return function ($selector = null, $method = null, $action = null) { 28 | $this->ensureResponseHasView(); 29 | 30 | $this->selectFormElement($selector); 31 | 32 | if ($this->form->getNode(0) === null) { 33 | Assert::fail('Form element does not exists.'); 34 | 35 | return $this; 36 | } 37 | 38 | if ($method !== null && strcasecmp($method, $this->getFormMethod()) !== 0) { 39 | Assert::fail('Form (action: '.$this->form->attr('action').') (method: '.$this->form->attr('method').') does not have '.$method.' method.'); 40 | 41 | return $this; 42 | } 43 | 44 | if ($action !== null && strcasecmp($action, $this->form->attr('action')) !== 0) { 45 | Assert::fail('Form (action: '.$this->form->attr('action').') does not have '.$action.' action.'); 46 | 47 | return $this; 48 | } 49 | 50 | $this->pass(); 51 | 52 | return $this; 53 | }; 54 | } 55 | 56 | public function assertFormHasCSRF() 57 | { 58 | return function () { 59 | if ($this->form->filter('input[type="hidden"][name="_token"]')->getNode(0) === null) { 60 | Assert::fail('Form is missing CSRF protection. Add @csrf to the view.'); 61 | } 62 | 63 | $this->pass(); 64 | 65 | return $this; 66 | }; 67 | } 68 | 69 | public function assertFormHasSubmitButton() 70 | { 71 | return function ($name = null, $value = null) { 72 | return $this->assertFormHasButtonInput('submit', $name, $value); 73 | }; 74 | } 75 | 76 | public function assertFormHasButtonInput() 77 | { 78 | return function ($type = 'submit', $name = null, $value = null) { 79 | 80 | $findable = 'button[type="'.$type.'"]'; 81 | 82 | if ($value !== null) { 83 | $findable .= '[value="'.$value.'"]'; 84 | } 85 | 86 | if ($name !== null) { 87 | $findable .= '[name="'.$name.'"]'; 88 | } 89 | 90 | if ($this->form->filter($findable)->getNode(0) === null) { 91 | Assert::fail('Form does not have submit button.'); 92 | } 93 | 94 | $this->pass(); 95 | 96 | return $this; 97 | }; 98 | } 99 | 100 | public function assertFormHasTextInput() 101 | { 102 | return function ($name = null, $value = null) { 103 | return $this->assertFormHasField('text', $name, $value); 104 | }; 105 | } 106 | 107 | public function assertFormHasColorInput() 108 | { 109 | return function ($name = null, $value = null) { 110 | return $this->assertFormHasField('color', $name, $value); 111 | }; 112 | } 113 | 114 | public function assertFormHasDateInput() 115 | { 116 | return function ($name = null, $value = null) { 117 | return $this->assertFormHasField('date', $name, $value); 118 | }; 119 | } 120 | 121 | public function assertFormHasDateLocalInput() 122 | { 123 | return function ($name = null, $value = null) { 124 | return $this->assertFormHasField('datetime-local', $name, $value); 125 | }; 126 | } 127 | 128 | public function assertFormHasEmailInput() 129 | { 130 | return function ($name = null, $value = null) { 131 | return $this->assertFormHasField('email', $name, $value); 132 | }; 133 | } 134 | 135 | public function assertFormHasFileInput() 136 | { 137 | return function ($name = null, $value = null) { 138 | return $this->assertFormHasField('file', $name, $value); 139 | }; 140 | } 141 | 142 | public function assertFormHasHiddenInput() 143 | { 144 | return function ($name = null, $value = null) { 145 | return $this->assertFormHasField('hidden', $name, $value); 146 | }; 147 | } 148 | 149 | public function assertFormHasImageInput() 150 | { 151 | return function ($name = null, $value = null) { 152 | return $this->assertFormHasField('image', $name, $value); 153 | }; 154 | } 155 | 156 | public function assertFormHasMonthInput() 157 | { 158 | return function ($name = null, $value = null) { 159 | return $this->assertFormHasField('month', $name, $value); 160 | }; 161 | } 162 | 163 | public function assertFormHasNumberInput() 164 | { 165 | return function ($name = null, $value = null) { 166 | return $this->assertFormHasField('number', $name, $value); 167 | }; 168 | } 169 | 170 | public function assertFormHasPasswordInput() 171 | { 172 | return function ($name = null, $value = null) { 173 | return $this->assertFormHasField('password', $name, $value); 174 | }; 175 | } 176 | 177 | public function assertFormHasRangeInput() 178 | { 179 | return function ($name = null, $value = null) { 180 | return $this->assertFormHasField('range', $name, $value); 181 | }; 182 | } 183 | 184 | public function assertFormHasResetInput() 185 | { 186 | return function ($name = null, $value = null) { 187 | return $this->assertFormHasField('reset', $name, $value); 188 | }; 189 | } 190 | 191 | public function assertFormHasSearchInput() 192 | { 193 | return function ($name = null, $value = null) { 194 | return $this->assertFormHasField('search', $name, $value); 195 | }; 196 | } 197 | 198 | public function assertFormHasTelInput() 199 | { 200 | return function ($name = null, $value = null) { 201 | return $this->assertFormHasField('tel', $name, $value); 202 | }; 203 | } 204 | 205 | public function assertFormHasTimeInput() 206 | { 207 | return function ($name = null, $value = null) { 208 | return $this->assertFormHasField('time', $name, $value); 209 | }; 210 | } 211 | 212 | public function assertFormHasUrlInput() 213 | { 214 | return function ($name = null, $value = null) { 215 | return $this->assertFormHasField('url', $name, $value); 216 | }; 217 | } 218 | 219 | public function assertFormHasWeekInput() 220 | { 221 | return function ($name = null, $value = null) { 222 | return $this->assertFormHasField('week', $name, $value); 223 | }; 224 | } 225 | 226 | public function assertFormHasDropdown() 227 | { 228 | return function ($name = null) { 229 | return $this->assertFormHasField('select', $name); 230 | }; 231 | } 232 | 233 | public function assertFormHasCheckboxInput() 234 | { 235 | return function ($name = null, $value = null) { 236 | return $this->assertFormHasField('checkbox', $name, $value); 237 | }; 238 | } 239 | 240 | public function assertFormHasRadioInput() 241 | { 242 | return function ($name = null, $value = null) { 243 | return $this->assertFormHasField('radio', $name, $value); 244 | }; 245 | } 246 | 247 | //id, name, selector, class = id, name, selector, class 248 | public function assertElementHasChild() 249 | { 250 | return function ($parentSelector, $childSelector) { 251 | $this->ensureResponseHasView(); 252 | 253 | $crawler = new Crawler($this->getContent()); 254 | $parentElement = $crawler->filter($parentSelector); 255 | 256 | if ($parentElement === null) { 257 | throw new Exception('Parent element does not exists.'); 258 | } 259 | 260 | if ($parentElement->filter($childSelector)->getNode(0) === null) { 261 | Assert::fail('Child element '.$childSelector.' does not exist.'); 262 | } 263 | 264 | $this->pass(); 265 | 266 | return $this; 267 | }; 268 | } 269 | 270 | public function assertElementMissigChild() 271 | { 272 | return function ($parentSelector, $childSelector) { 273 | $this->ensureResponseHasView(); 274 | 275 | $crawler = new Crawler($this->getContent()); 276 | $parentElement = $crawler->filter($parentSelector); 277 | 278 | if ($parentElement === null) { 279 | throw new Exception('Parent element does not exists.'); 280 | } 281 | 282 | if ($parentElement->filter($childSelector)->getNode(0) !== null) { 283 | Assert::fail('Child element '.$childSelector.' does exist.'); 284 | } 285 | 286 | $this->pass(); 287 | 288 | return $this; 289 | }; 290 | } 291 | 292 | public function assertFieldHasValidationErrorMsg() 293 | { 294 | return function ($errorMsg) { 295 | if (! Str::of($this->form->text())->contains($errorMsg)) { 296 | Assert::fail('Form does not have validation error text.'); 297 | } 298 | 299 | $this->pass(); 300 | 301 | return $this; 302 | }; 303 | } 304 | 305 | public function assertFormHasField() 306 | { 307 | return function ($type, $name = null, $value = null) { 308 | $msg = "Form does not have $type field"; 309 | if ($type === 'select') { 310 | $filterable = 'select'; 311 | } else { 312 | $filterable = 'input[type="'.$type.'"]'; 313 | } 314 | 315 | if ($name !== null) { 316 | $filterable .= '[name='.$this->escapeName($name).']'; 317 | $msg .= " named $name."; 318 | } 319 | 320 | if ($value !== null && $type !== 'select') { 321 | $filterable .= '[value="'.$value.'"]'; 322 | } 323 | 324 | if ($this->form->filter($filterable)->getNode(0) === null) { 325 | Assert::fail($msg); 326 | } 327 | 328 | $this->pass(); 329 | 330 | return $this; 331 | }; 332 | } 333 | 334 | public function assertFormHasTextarea() 335 | { 336 | return function ($name = null, $text = null) { 337 | $filterable = 'textarea'; 338 | 339 | if ($name !== null) { 340 | $filterable .= '[name="'.$this->escapeName($name).'"]'; 341 | } 342 | 343 | if ($this->form->filter($filterable)->getNode(0) === null) { 344 | Assert::fail("Form does not have textarea with name {$name}."); 345 | } 346 | 347 | if ($text === null) { 348 | $this->pass(); 349 | 350 | return $this; 351 | } 352 | 353 | if ($this->form->filter($filterable)->text() !== $text) { 354 | Assert::fail("Form does not have textarea with {$text} text."); 355 | } 356 | 357 | $this->pass(); 358 | 359 | return $this; 360 | }; 361 | } 362 | 363 | protected function selectFormElement() 364 | { 365 | return function ($selector = null) { 366 | $crawler = new Crawler($this->getContent()); 367 | $filterable = 'form'; 368 | if ($selector !== null) { 369 | $filterable .= "[$selector]"; 370 | } 371 | 372 | try { 373 | $this->form = $crawler->filter($filterable); 374 | } catch (SyntaxErrorException $e) { 375 | $this->form = $crawler->filter($selector); 376 | } 377 | 378 | return $this; 379 | }; 380 | } 381 | 382 | protected function getFormMethod() 383 | { 384 | return function () { 385 | if ($this->form->filter('input[type="hidden"][name="_method"]')->getNode(0) !== null) { 386 | return $this->form->filter('input[type="hidden"][name="_method"]')->attr('value'); 387 | } 388 | 389 | return $this->form->attr('method'); 390 | }; 391 | } 392 | 393 | protected function pass() 394 | { 395 | return function () { 396 | Assert::assertNull(null); 397 | }; 398 | } 399 | 400 | protected function escapeName() 401 | { 402 | return function ($name) { 403 | if (strpos($name, '\\[') !== false && strpos($name, '\\]') !== false) { 404 | return $name; 405 | } 406 | 407 | return str_replace(['[', ']'], ['\\[', '\\]'], $name); 408 | }; 409 | } 410 | } 411 | --------------------------------------------------------------------------------