Skip to content
Snippets Groups Projects
Commit cc689e4a authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Make some more assertions in Cron module tests

parent 13c5009e
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,14 @@ class CronTest extends TestCase ...@@ -84,6 +84,14 @@ class CronTest extends TestCase
$response = $c->info(); $response = $c->info();
$this->assertTrue($response->isSuccessful()); $this->assertTrue($response->isSuccessful());
$expect = [
'exec_href' => 'http://localhost/simplesaml/module.php/cron/run/daily/secret',
'href' => 'http://localhost/simplesaml/module.php/cron/run/daily/secret/xhtml',
'tag' => 'daily',
'int' => '02 0 * * *',
];
$this->assertCount(1, $response->data['urls']);
$this->assertEquals($expect, $response->data['urls'][0]);
} }
...@@ -97,5 +105,10 @@ class CronTest extends TestCase ...@@ -97,5 +105,10 @@ class CronTest extends TestCase
$response = $c->run('daily', 'secret'); $response = $c->run('daily', 'secret');
$this->assertTrue($response->isSuccessful()); $this->assertTrue($response->isSuccessful());
$this->assertEquals('daily', $response->data['tag']);
$this->assertFalse($response->data['mail_required']);
$this->assertArrayHasKey('time', $response->data);
$this->assertCount(1, $response->data['summary']);
$this->assertEquals('Cron did run tag [daily] at ' . $response->data['time'], $response->data['summary'][0]);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment