Skip to content

Commit

Permalink
Some clean
Browse files Browse the repository at this point in the history
  • Loading branch information
fezfez committed Mar 13, 2023
1 parent 5c6b25b commit 7b9d5d7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^8.1",
"php": "~8.1.0 || ~8.2.0",
"dragonmantank/cron-expression": "^3.3.2",
"symfony/lock": "^6.2.7",
"symfony/process": "^6.2.7"
Expand Down
9 changes: 8 additions & 1 deletion phpunit.xml
@@ -1,5 +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" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
executionOrder="random"
resolveDependencies="true">
<coverage>
<include>
<directory suffix=".php">./src</directory>
Expand Down
23 changes: 23 additions & 0 deletions tests/Unit/Job/CliJobTest.php
Expand Up @@ -46,5 +46,28 @@ public function testFromArray(): void
self::assertSame('myName', $sUT->getName());
self::assertSame(100, $sUT->getTtl());
self::assertTrue($sUT->isAutoRelease());

$sUT = CliJob::fromArray([
'command' => 'toto',
'cronExpression' => 'hello',
'name' => 'myName',
'ttl' => 10,
'autoRelease' => false,
]);

self::assertSame('hello', $sUT->getCronExpression());
self::assertSame('myName', $sUT->getName());
self::assertSame(10, $sUT->getTtl());
self::assertFalse($sUT->isAutoRelease());

$sUT = CliJob::fromArray([
'command' => 'toto',
'cronExpression' => 'hello',
]);

self::assertSame('hello', $sUT->getCronExpression());
self::assertSame('toto', $sUT->getName());
self::assertSame(300, $sUT->getTtl());
self::assertTrue($sUT->isAutoRelease());
}
}

0 comments on commit 7b9d5d7

Please sign in to comment.