Commit graph

422 commits

Author SHA1 Message Date
Koji Tanaka
5ae08a4dba fixed: CakeFixtureManager::_setupTable() is called outside of transaction
Fixed PDOException thrown with the message "There is no active transaction" in PHP 8.0+.
SQL like CREATE/DROP/TRUNCATE TABLE implicitly commits just before.
In PHP 8.0+, calling commit/rollback afterwards will now throw a PDOException.
2023-01-11 22:45:29 +01:00
Koji Tanaka
b1229c9107 test: Removed pre-checking of tests that were skipped in the PHPUnit version since the minimum version is now 9.5. 2023-01-11 22:45:29 +01:00
Koji Tanaka
a1ed2f91b3 test: Remove expectError() and expectException()
These are incompatible signature with the PHPUnit 9 method of the same name.
2023-01-11 22:45:29 +01:00
Koji Tanaka
a95654de88 clean: Stop overriding TestCase::run().
Overriding the run method to perform fixture management processing is no longer necessary since moved it to CakeFixtureInjector.

Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
2023-01-11 22:45:29 +01:00
Koji Tanaka
75716f76bc test: Add return type declarations to overridden methods of TestCase classes. 2023-01-11 22:45:29 +01:00
Koji Tanaka
0692ce5b62 test: Updated TestSuite class for PHPUnit 9.5 2023-01-11 22:45:29 +01:00
Koji Tanaka
bd633c023a feat: Implement a fixture callback class using the PHPUnit TestListener interface. 2023-01-11 22:45:29 +01:00
Markus Podar
459ee900fe
php-7.4-compact: replace deprecated curly brace offset access
Per https://wiki.php.net/rfc/deprecate_curly_braces_array_access and https://www.php.net/manual/en/migration74.deprecated.php
>  The array and string offset access syntax using curly braces is deprecated. Use $var[$idx] instead of $var{$idx}.
2020-03-20 21:10:58 +01:00
Corey Taylor
eda72a6f3b Updated CakeTestSuiteCommand::run() exit logic to match phpunit's behavior now that doRun() is called with =false. 2019-12-06 01:15:11 -06:00
Gerson Felipe Schwinn
cf49efdf0e Solving headers already sent bug on sessions whit phpunit.phar 2019-09-26 09:00:11 -03:00
Gareth Ellis
dba84d65d7 Corrects style error from PHPCS by prefixing method name with an underscore 2019-07-29 15:27:45 +01:00
Gareth Ellis
f198ffdb9c Moves creation of ControllerTestDispatcher to its own protected method 2019-07-29 10:35:43 +01:00
Koji Tanaka
d09e827f6c Pass $exit arguments to the parent doRun() method and $exit is false 2019-06-01 22:59:30 +09:00
bancer
53e3df20d0 Replace hard coded test directory paths with constants, fixes #12636
The `TESTS` constant definition is moved from bootstrap.php in order
to make it possible to set the constant in test.php or in the project's
bootstrap file so that CakePHP would detect tests in a different folder.
2018-10-26 13:49:53 +02:00
Val Bancer
a05c09c1f4
Improve code style 2018-08-14 12:33:49 +02:00
Val Bancer
e56452b2c5
Improve code style 2018-08-14 12:31:58 +02:00
Val Bancer
f5bf22e1e3
Do not unset $this->fixtures 2018-08-13 17:13:47 +02:00
Val Bancer
0e02af091a
Move unset to the proper place 2018-08-13 15:28:10 +02:00
Val Bancer
727aac1713
Move unset to the proper place 2018-08-13 15:06:19 +02:00
Val Bancer
cb23bf9223
Remove whitespace 2018-08-13 14:38:54 +02:00
Val Bancer
b45fe026f5
Unset more properties to free more memory 2018-08-13 14:20:29 +02:00
Val Bancer
dbbc8400b6
Free some memory in unit tests 2018-08-13 13:09:22 +02:00
Val Bancer
8bfdcdb637
Free some memory in unit tests 2018-08-13 12:26:26 +02:00
Mark Story
ee02d4274f
Merge pull request #11750 from bancer/11528-code-coverage
fixes Error: Class 'PHP_CodeCoverage' not found error
2018-07-13 13:24:19 -04:00
Kazuki Higashiguchi
722a2b3286 In getMockForModel, place useDbConfig test_xxx 2018-03-10 10:51:30 +09:00
Val Bancer
9185fb10e2
fixes Error: Class 'PHP_CodeCoverage' not found error 2018-02-23 16:21:33 +01:00
Val Bancer
1b11fa7a7a
Constructs the default fixture manager if 'fixtureManager' parameter is an empty string. 2018-02-05 16:07:33 +01:00
Mark Story
83928f9d74
Merge pull request #11590 from cakephp/issue-11588
Buffer contents of HtmlReporter.
2017-12-31 21:13:28 -05:00
Koji Tanaka
74a8611eef [2.x]Fix can't load aliased component on ControllerTestCase 2017-12-31 15:44:05 +09:00
mark_story
d2c4bf2bb2 Buffer contents of HtmlReporter.
Collect HTML output into a buffer so we can provide compatibility across
PHPUnit 3.x and 4.x

Refs #11588
2017-12-30 23:47:11 -05:00
Val Bancer
a2cc9843e4
added missing ob_end_flush() call 2017-11-21 15:20:14 +01:00
Mark Story
12a2909e71 Merge pull request #11000 from bancer/truncate-performance-2
Improved performance of CakeFixtureManager.
2017-08-11 21:48:01 -04:00
Luis Cano
1e5ea2451a Fixes "Whitespace found at end of line" 2017-08-08 14:42:57 -04:00
Luis Cano
3307665cbb Fixed syntax to work with PHP5.3 2017-08-08 14:28:11 -04:00
Luis Cano
9f175f22f4 Abiding to code standards 2017-08-08 12:59:33 -04:00
Luis Cano
90f14bc07b fixes cakephp/cakephp#11016 2017-08-08 12:28:57 -04:00
Val Bancer
d91059460b Improved performance of CakeFixtureManager. 2017-08-05 22:15:10 +02:00
mark_story
7c2ad08da5 Clean up formatting.
Refs #10912
2017-08-03 13:17:05 -04:00
Val Bancer
5e92034ad8 improved code style 2017-07-18 22:31:28 +02:00
Val Bancer
7ba52d0c53 Fixed code style. 2017-07-16 00:27:20 +02:00
Val Bancer
93696b65e4 Fixed indefinite loop in getMock(). 2017-07-16 00:09:36 +02:00
Val Bancer
eefd3ac847 adapter for the getMock() depricated in phpunit 2017-07-15 23:23:14 +02:00
mark_story
2032fef772 Merge branch '2.x' into 2.next 2017-06-26 21:51:41 -04:00
Marc Würth
88aadf3804 Use HTTPS for the www.cakephp.org URL
Do not change those in tests.
2017-06-11 00:43:06 +02:00
Marc Würth
da8414e13b Use HTTPS for the opensource.org MIT license URL 2017-06-11 00:23:22 +02:00
Marc Würth
04efc7ba50 Use HTTPS for the book.cakephp.org URL 2017-06-11 00:15:36 +02:00
Marc Würth
10b89b51a9 Use HTTPS for the cakefoundation.org URL 2017-06-11 00:10:59 +02:00
Marc Würth
17314baa15 Use HTTPS for the cakephp.org URL 2017-06-10 23:40:28 +02:00
mark_story
cf679a3233 Merge branch '2.x' into 2.next 2017-05-27 21:47:22 -04:00
Marc Würth
bef0c766b6 Add inline type hint annotations
Improves the experience when debugging in an IDE
2017-05-16 13:24:25 +02:00