File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 "laravel/sail" : " ^1.26" ,
2222 "mockery/mockery" : " ^1.6" ,
2323 "nunomaduro/collision" : " ^8.1" ,
24- "pestphp/pest" : " ^3.7" ,
25- "pestphp/pest-plugin-laravel" : " ^3.1"
24+ "pestphp/pest" : " ^4.0" ,
25+ "pestphp/pest-plugin-browser" : " ^4.0" ,
26+ "pestphp/pest-plugin-laravel" : " ^4.0"
2627 },
2728 "autoload" : {
2829 "psr-4" : {
7374 "php-http/discovery" : true
7475 }
7576 },
76- "minimum-stability" : " stable " ,
77+ "minimum-stability" : " dev " ,
7778 "prefer-stable" : true
7879}
Original file line number Diff line number Diff line change 2222 <env name =" APP_MAINTENANCE_DRIVER" value =" file" />
2323 <env name =" BCRYPT_ROUNDS" value =" 4" />
2424 <env name =" CACHE_STORE" value =" array" />
25- <!-- < env name="DB_CONNECTION" value="sqlite"/> -- >
26- <!-- < env name="DB_DATABASE" value=":memory:"/> -- >
25+ <env name =" DB_CONNECTION" value =" sqlite" />
26+ <env name =" DB_DATABASE" value =" :memory:" />
2727 <env name =" MAIL_MAILER" value =" array" />
2828 <env name =" PULSE_ENABLED" value =" false" />
2929 <env name =" QUEUE_CONNECTION" value =" sync" />
Original file line number Diff line number Diff line change 1+ @extends (' layouts.app' )
2+
3+ @section (' content' )
4+ <h1 >
5+ Nunonation Database
6+ </h1 >
7+ @endsection
Original file line number Diff line number Diff line change 1111Route::get ('/test/{page} ' , function ($ page ) {
1212 return view ('test-pages. ' .$ page );
1313})->name ('test-page ' );
14+
15+ Route::get ('/database ' , function () {
16+ return view ('database ' );
17+ })->name ('database ' );
Original file line number Diff line number Diff line change 33declare (strict_types=1 );
44
55it ('returns a successful response ' , function () {
6- $ response = $ this -> get ( ' / ' );
6+ $ page = page ()-> goto ( route ( ' database ' ) );
77
8- $ response -> assertStatus ( 200 );
8+ expect ( $ page -> locator ( ' h1 ' ))-> toHaveText ()( ' Nunonation Database ' );
99});
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ it ('may have a title ' , function (): void {
6+ $ page = page ()->goto ('/ ' );
7+
8+ $ locator = $ page ->locator ('h3 ' );
9+
10+ expect ($ locator )->toHaveText ('Pest is a testing ' );
11+ });
12+
13+ it ('may not have a title ' , function (): void {
14+ $ page = page ()->goto ('/ ' );
15+
16+ $ locator = $ page ->locator ('h3 ' );
17+
18+ expect ($ locator )->not ->toHaveText ('PhpUnit is a testing framework ' );
19+ });
Original file line number Diff line number Diff line change 1818 return $ this ;
1919});
2020
21+ expect ()->extend ('toHaveText ' , function (string $ content ): Expectation {
22+ if (! $ this ->value instanceof Locator) {
23+ throw new InvalidArgumentException ('Expected value to be an Locator instance ' );
24+ }
25+
26+ expect ($ this ->value ->textContent ())->toContain ($ content );
27+
28+ return $ this ;
29+ });
30+
2131expect ()->extend ('toBeChecked ' , function (): Expectation {
2232 if (! $ this ->value instanceof Locator) {
2333 throw new InvalidArgumentException ('Expected value to be a Locator instance ' );
6171});
6272
6373expect ()->extend ('toBeEditable ' , function (): Expectation
64-
74+ {
6575 if (! $ this ->value instanceof Locator) {
6676 throw new InvalidArgumentException ('Expected value to be a Locator instance ' );
6777 }
You can’t perform that action at this time.
0 commit comments