From cc689e4af4bb4ced8d38f10a09bddab8fa0b804f Mon Sep 17 00:00:00 2001
From: Thijs Kinkhorst <thijs@kinkhorst.com>
Date: Mon, 10 Jan 2022 10:43:46 +0000
Subject: [PATCH] Make some more assertions in Cron module tests

---
 tests/modules/cron/lib/Controller/CronTest.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/modules/cron/lib/Controller/CronTest.php b/tests/modules/cron/lib/Controller/CronTest.php
index e543a6dad..350b19eee 100644
--- a/tests/modules/cron/lib/Controller/CronTest.php
+++ b/tests/modules/cron/lib/Controller/CronTest.php
@@ -84,6 +84,14 @@ class CronTest extends TestCase
         $response = $c->info();
 
         $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
         $response = $c->run('daily', 'secret');
 
         $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]);
     }
 }
-- 
GitLab