diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index 143f8b70ce..ae17e54f41 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -2,12 +2,11 @@ namespace Appwrite\Tests; -use Exception; use Utopia\Request; use Event\Event; use PHPUnit\Framework\TestCase; -class LocaleTest extends TestCase +class EventTest extends TestCase { /** * @var Event diff --git a/tests/unit/Task/Validator/CronTest.php b/tests/unit/Task/Validator/CronTest.php new file mode 100644 index 0000000000..b55e076f3f --- /dev/null +++ b/tests/unit/Task/Validator/CronTest.php @@ -0,0 +1,37 @@ +object = new Cron(); + } + + public function tearDown() + { + } + + public function testValues() + { + $this->assertEquals($this->object->isValid('0 2 * * *'), true); // execute at 2am daily + $this->assertEquals($this->object->isValid('0 5,17 * * *'), true); // execute twice a day + $this->assertEquals($this->object->isValid('* * * * *'), true); // execute on every minutes + // $this->assertEquals($this->object->isValid('0 17 * * sun'), true); // execute on every Sunday at 5 PM + $this->assertEquals($this->object->isValid('*/10 * * * *'), true); // execute on every 10 minutes + // $this->assertEquals($this->object->isValid('* * * jan,may,aug *'), true); // execute on selected months + // $this->assertEquals($this->object->isValid('0 17 * * sun,fri'), true); // execute on selected days + // $this->assertEquals($this->object->isValid('0 2 * * sun'), true); // execute on first sunday of every month + $this->assertEquals($this->object->isValid('0 */4 * * *'), true); // execute on every four hours + // $this->assertEquals($this->object->isValid('0 4,17 * * sun,mon'), true); // execute twice on every Sunday and Monday + } +} \ No newline at end of file