Skip to content

Commit c23c190

Browse files
Test travis (#259)
* In PHP 8 now throws ValueError exception * Too big trace for Objects in print_r * Fix case when test already runned from another CacheWorker and Singleton been initialized * Try to install lower pecl packege * Add testing at PHP 8, add check for PHP version and install defferent versions of memcache
1 parent 6776ab7 commit c23c190

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist: xenial
12
language: php
23
services:
34
- mysql
@@ -6,8 +7,14 @@ services:
67
- memcached
78
php:
89
- 7.4.6
10+
- 8.0.2
911
before_install:
10-
- yes | pecl install memcache
12+
- |
13+
if (php --version | grep -i 7.4 > /dev/null); then
14+
yes | pecl install memcache-4.0.5.2
15+
else
16+
yes | pecl install memcache
17+
fi
1118
- no | pecl install memcached
1219
- echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
1320
- mysql -e 'CREATE DATABASE onphp;'

src/Main/Util/ClassUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ public static function checkStaticMethod($methodSignature): array
259259
} elseif (is_string($methodSignature)) {
260260
$nameParts = explode('::', $methodSignature);
261261
} else {
262-
Assert::isUnreachable('Incorrect method signature ' . Assert::dumpArgument($methodSignature));
262+
Assert::isUnreachable('Incorrect method signature ' . gettype($methodSignature));
263263
}
264264

265265
Assert::isEqual(
266266
count($nameParts),
267267
2,
268-
'Incorrect method signature ' . Assert::dumpArgument($methodSignature)
268+
'Incorrect method signature ' . gettype($methodSignature)
269269
);
270270

271271
list($className, $methodName) = $nameParts;

src/Main/Util/Router/RouterRegexpRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace OnPHP\Main\Util\Router;
1313

14+
use Throwable;
1415
use OnPHP\Core\Base\Assert;
1516
use OnPHP\Main\Flow\HttpRequest;
16-
use OnPHP\Core\Exception\BaseException;
1717

1818
final class RouterRegexpRule extends RouterBaseRule
1919
{
@@ -132,7 +132,7 @@ public function assembly(
132132

133133
try {
134134
$return = vsprintf($this->reverse, $mergedData);
135-
} catch (BaseException $e) {
135+
} catch (Throwable $e) {
136136
throw new RouterException(
137137
'Can not assembly. Too few arguments? Error was: '
138138
.$e->getMessage()

tests/Core/SingletonTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public function testCreationProhibition()
6767

6868
public function testMissingCleanup()
6969
{
70+
if (isset(Singleton::getAllInstances()[self::SINGLE_CLASS_NAME])) {
71+
Singleton::dropInstance(self::SINGLE_CLASS_NAME);
72+
}
73+
7074
// cleaning up
7175
$this->expectException(MissingElementException::class);
7276
Singleton::dropInstance(self::SINGLE_CLASS_NAME);

0 commit comments

Comments
 (0)