Page MenuHomeDevCentral

D1805.id4573.diff
No OneTemporary

D1805.id4573.diff

diff --git a/TommyTest.php b/TommyTest.php
--- a/TommyTest.php
+++ b/TommyTest.php
@@ -5,23 +5,45 @@
class TommyTest extends PHPUnit\Framework\TestCase {
use assertHttp;
- public function testIsLive () {
- $this->assertHttpResponseCode(200, 'http://builds.nasqueron.org', 'Tommy looks down.');
- $this->assertHttpResponseCode(404, 'http://builds.nasqueron.org/notexisting', 'A 404 code were expected for a not existing page.');
+ /**
+ * @dataProvider provideTommyInstances
+ */
+ public function testIsLive (string $url) {
+ $this->assertHttpResponseCode(200, $url, 'Tommy looks down.');
+ $this->assertHttpResponseCode(404, $url . '/notexisting', 'A 404 code were expected for a not existing page.');
}
- public function testSSL () {
- $this->assertHttpResponseCode(200, 'https://builds.nasqueron.org/', "Tommy HTTPS issue.");
+ /**
+ * @dataProvider provideTommyInstances
+ */
+ public function testSSL (string $url) {
+ $this->assertHttpResponseCode(200, $url . '/', "Tommy HTTPS issue.");
}
- public function testAlive () {
- $url = 'https://builds.nasqueron.org/status';
+ /**
+ * @dataProvider provideTommyInstances
+ */
+ public function testAlive (string $url) {
+ $url = $url . '/status';
$this->assertHttpResponseCode(200, $url);
$this->assertSame('ALIVE', file_get_contents($url));
}
- public function testDashboard () {
- $content = file_get_contents('https://builds.nasqueron.org');
- $this->assertContains('ci.nasqueron.org/job/', $content);
+ /**
+ * @dataProvider provideTommyInstances
+ */
+ public function testDashboard (string $url, string $instance) {
+ $content = file_get_contents($url . '');
+ $this->assertContains($instance . '/job/', $content);
}
+
+ ///
+ /// Data providers
+ ///
+
+ public function provideTommyInstances () : iterable {
+ yield ["https://builds.nasqueron.org", "ci.nasqueron.org"];
+ yield ["https://infra.nasqueron.org/cd/dashboard", "cd.nasqueron.org"];
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 15, 21:18 (1 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2735648
Default Alt Text
D1805.id4573.diff (2 KB)

Event Timeline