Skip to content

Commit

Permalink
updated:
Browse files Browse the repository at this point in the history
1. modified CI.yml
2. modified BaseTestCase.php
  • Loading branch information
chaz6chez committed May 6, 2023
1 parent 8f66341 commit fbf60bd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: pcntl, posix
tools: phpunit:10, composer:v2
tools: phpunit:9, composer:v2
coverage: none
- run: composer install
- run: vendor/bin/phpunit
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/.idea
/.vscode
/vendor
/tests/cache
composer.lock
identifier.sqlite
.phpunit.cache
.phpunit.result.cache
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"require-dev": {
"symfony/var-dumper": "^5.0 | ^6.0",
"phpunit/phpunit": "^9.0 | ^10.0"
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 2 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
defaultTimeLimit="10"
colors="true"
testdox="true"
stopOnWarning="true">
<testsuites>
<testsuite name="process">
Expand Down
2 changes: 2 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.cache
!.gitignore
8 changes: 4 additions & 4 deletions tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function runtime(bool $reset = false): ?Runtime
*/
public function write(string $file, string $content): void
{
file_put_contents(__DIR__ . '/cache/' . $file . '.cache', $content, FILE_APPEND|LOCK_EX);
file_put_contents(__DIR__ . "/$file.cache", $content, FILE_APPEND|LOCK_EX);
}

/**
Expand All @@ -48,7 +48,7 @@ public function write(string $file, string $content): void
*/
public function read(string $file): string
{
if(file_exists($file = __DIR__ . '/cache/' . $file . '.cache')){
if(file_exists($file = __DIR__ . "/$file.cache")){
return trim(file_get_contents($file));
}
throw new \RuntimeException('Cache Not Found : ' . $file);
Expand All @@ -59,15 +59,15 @@ public function read(string $file): string
*/
public function removeAllCaches()
{
array_map('unlink', glob( __DIR__ . '/cache/*.cache'));
array_map('unlink', glob( __DIR__ . '/*.cache'));
}

/**
* @return void
*/
public function removeCache(string $file)
{
if(file_exists($file = __DIR__ . '/cache/' . $file . '.cache')){
if(file_exists($file = __DIR__ . "/$file.cache")){
@unlink($file);
}
}
Expand Down

0 comments on commit fbf60bd

Please sign in to comment.