File tree Expand file tree Collapse file tree 7 files changed +27
-27
lines changed
Expand file tree Collapse file tree 7 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ phpstan-baseline.neon export-ignore
1818phpunit.xml.dist export-ignore
1919psalm.xml export-ignore
2020psalm-baseline.xml export-ignore
21+ .phive export-ignore
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phive xmlns =" https://phar.io/phive" >
3+ <phar name =" phpstan" version =" 1.10.38" installed =" 1.10.38" location =" ./tools/phpstan" copy =" false" />
4+ <phar name =" psalm" version =" 5.15.0" installed =" 5.15.0" location =" ./tools/psalm" copy =" false" />
5+ </phive >
Original file line number Diff line number Diff line change @@ -191,10 +191,12 @@ scope in your app's `routes.php`.
191191``` php
192192// PostsController.php
193193
194- // Override the viewClasses method of your controller:
195- public function viewClasses()
194+ // Add the CsvView class for content type negotiation
195+ public function initialize(): void
196196{
197- return ['csv' => 'CsvView.Csv'];
197+ parent::initialize();
198+
199+ $this->addViewClasses(['csv' => 'CsvView.Csv']);
198200}
199201
200202// Controller action
Original file line number Diff line number Diff line change 4444 }
4545 ],
4646 "require" : {
47- "php" : " >=8.1" ,
48- "cakephp/cakephp" : " 5.x-dev"
47+ "cakephp/cakephp" : " ^5.0"
4948 },
5049 "require-dev" : {
51- "phpunit/phpunit" : " ^9.5.0 " ,
50+ "phpunit/phpunit" : " ^10.1 " ,
5251 "cakephp/cakephp-codesniffer" : " ^5.0"
5352 },
5453 "autoload" : {
8584 "allow-plugins" : {
8685 "dealerdirect/phpcodesniffer-composer-installer" : true
8786 }
88- },
89- "minimum-stability" : " dev" ,
90- "prefer-stable" : true
87+ }
9188}
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit bootstrap =" tests/bootstrap.php" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd" >
3-
4- <!-- Add any additional test suites you want to run here -->
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" bootstrap =" tests/bootstrap.php" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.4/phpunit.xsd" >
53 <testsuites >
64 <testsuite name =" csv-view" >
7- <directory >tests/TestCase/</directory >
5+ <directory >tests/TestCase/</directory >
86 </testsuite >
97 </testsuites >
10-
11- <!-- Setup a listener for fixtures -->
128 <extensions >
13- <extension class =" \ Cake\TestSuite\Fixture\PHPUnitExtension" />
9+ <bootstrap class =" Cake\TestSuite\Fixture\Extension \PHPUnitExtension" />
1410 </extensions >
15-
16- <coverage >
17- <include >
18- <directory suffix =" .php" >src/</directory >
19- </include >
20- </coverage >
21-
2211 <php >
2312 <env name =" FIXTURE_SCHEMA_METADATA" value =" ./tests/schema.php" />
2413 </php >
14+ <source >
15+ <include >
16+ <directory suffix =" .php" >src/</directory >
17+ </include >
18+ </source >
2519</phpunit >
Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ public function testPassingQueryAsData()
441441 $ output = $ this ->view ->render ();
442442
443443 $ articles ->belongsTo ('Authors ' );
444- $ query = $ articles ->find ('all ' , [ ' contain ' => 'Authors ' ] );
444+ $ query = $ articles ->find ('all ' , contain: 'Authors ' );
445445 $ _extract = ['title ' , 'body ' , 'author.name ' ];
446446 $ this ->view ->set (['data ' => $ query ])
447447 ->setConfig (['extract ' => $ _extract , 'serialize ' => 'data ' ]);
Original file line number Diff line number Diff line change 22declare (strict_types=1 );
33
44use Cake \Core \Configure ;
5+ use Cake \TestSuite \Fixture \SchemaLoader ;
56
67/**
78 * Test suite bootstrap
4344 ],
4445]);
4546
46- if (env ('FIXTURE_SCHEMA_METADATA ' )) {
47- $ loader = new Cake \ TestSuite \ Fixture \ SchemaLoader ();
48- $ loader ->loadInternalFile (env ('FIXTURE_SCHEMA_METADATA ' ));
47+ if (getenv ('FIXTURE_SCHEMA_METADATA ' )) {
48+ $ loader = new SchemaLoader ();
49+ $ loader ->loadInternalFile (getenv ('FIXTURE_SCHEMA_METADATA ' ));
4950}
You can’t perform that action at this time.
0 commit comments