Page MenuHomeDevCentral

D789.id1997.diff
No OneTemporary

D789.id1997.diff

diff --git a/tests/Config/Reporting/IntegrationTest.php b/tests/Config/Reporting/IntegrationTest.php
new file mode 100644
--- /dev/null
+++ b/tests/Config/Reporting/IntegrationTest.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Nasqueron\Notifications\Tests\Config\Reporting;
+
+use Nasqueron\Notifications\Tests\TestCase;
+
+class IntegrationTest extends TestCase {
+
+ /**
+ * Nasqueron\Notifications\Services\Services
+ */
+ private $servicesMock;
+
+ public function setUp () {
+ parent::setUp();
+
+ $this->servicesMock = $this->mockServices();
+ }
+
+ /**
+ * Config works.
+ */
+ public function testConfig() {
+ $json = $this->get('/config')
+ ->response->getContent();
+
+ die($json);
+
+ $this->assertJsonStringEqualsJsonFile(
+ __DIR__ . "/../../data/config.json",
+ $json
+ );
+ }
+
+}
diff --git a/tests/TestCase.php b/tests/TestCase.php
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -2,6 +2,8 @@
namespace Nasqueron\Notifications\Tests;
+use Nasqueron\Notifications\Config\Services\Service;
+
use Illuminate\Contracts\Console\Kernel;
use Keruald\Broker\BlackholeBroker;
use Keruald\Broker\Broker;
@@ -99,6 +101,27 @@
}
///
+ /// Helper methods to mock services
+ ///
+
+ protected function mockServices () {
+ // Inject into our container a mock of Services
+ $mock = Mockery::mock('Nasqueron\Notifications\Config\Services\Services');
+ $this->app->instance('services', $mock);
+
+ return $mock;
+ }
+
+ protected function mockService ($gate = 'Storm') {
+ $service = new Service;
+ $service->gate = $gate;
+ $service->door = 'Acme';
+ $service->instance = "http://www.perdu.com";
+
+ return $service;
+ }
+
+ ///
/// Helpers to post data to gates
///
diff --git a/tests/data/config.json b/tests/data/config.json
new file mode 100644
--- /dev/null
+++ b/tests/data/config.json
@@ -0,0 +1,32 @@
+{
+ "gates": [
+ "DockerHub",
+ "GitHub",
+ "Jenkins",
+ "Phabricator"
+ ],
+ "features": [
+ {
+ "name": "Gate",
+ "enabled": true
+ },
+ {
+ "name": "ActionsReport",
+ "enabled": true
+ }
+ ],
+ "services": [
+ {
+ "gate": "GitHub",
+ "door": "Nasqueron",
+ "instance": "",
+ "status": ""
+ },
+ {
+ "gate": "Phabricator",
+ "door": "Nasqueron",
+ "instance": "https://devcentral.nasqueron.org",
+ "status": ""
+ }
+ ]
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 10:09 (5 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249180
Default Alt Text
D789.id1997.diff (2 KB)

Event Timeline