Skip to content

Commit 8804f72

Browse files
committed
Update tests/bootstrap.php
1 parent 78bc739 commit 8804f72

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/composer.lock
22
/vendor
33
/phpunit.xml
4+
.phpunit.result.cache
5+
.idea

tests/bootstrap.php

+2-17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
use Cake\Cache\Cache;
15+
use Cake\Chronos\Chronos;
1516
use Cake\Core\Configure;
1617
use Cake\Datasource\ConnectionManager;
1718
use Cake\Log\Log;
@@ -105,7 +106,6 @@
105106
}
106107

107108
ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]);
108-
ConnectionManager::setConfig('test_custom_i18n_datasource', ['url' => getenv('db_dsn')]);
109109

110110
Configure::write('Session', [
111111
'defaults' => 'php'
@@ -124,19 +124,4 @@
124124
]
125125
]);
126126

127-
if (class_exists('Carbon\Carbon')) {
128-
Carbon\Carbon::setTestNow(Carbon\Carbon::now());
129-
} else {
130-
Cake\Chronos\Chronos::setTestNow(Cake\Chronos\Chronos::now());
131-
Cake\Chronos\MutableDateTime::setTestNow(Cake\Chronos\MutableDateTime::now());
132-
Cake\Chronos\Date::setTestNow(Cake\Chronos\Date::now());
133-
Cake\Chronos\MutableDate::setTestNow(Cake\Chronos\MutableDate::now());
134-
}
135-
136-
if (class_exists('PHPUnit_Runner_Version')) {
137-
class_alias('PHPUnit_Framework_TestResult', 'PHPUnit\Framework\TestResult');
138-
class_alias('PHPUnit_Framework_Error', 'PHPUnit\Framework\Error\Error');
139-
class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\Framework\Error\Warning');
140-
class_alias('PHPUnit_Framework_Error_Notice', 'PHPUnit\Framework\Error\Notice');
141-
class_alias('PHPUnit_Framework_ExpectationFailedException', 'PHPUnit\Framework\ExpectationFailedException');
142-
}
127+
Chronos::setTestNow(Chronos::now());

0 commit comments

Comments
 (0)