Page MenuHomeDevCentral

D789.id.diff
No OneTemporary

D789.id.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,32 @@
+<?php
+
+namespace Nasqueron\Notifications\Tests\Config\Reporting;
+
+use Nasqueron\Notifications\Tests\TestCase;
+
+class IntegrationTest extends TestCase {
+
+ public function setUp () {
+ parent::setUp();
+
+ $this->mockServices()
+ ->shouldReceive('get')
+ ->once()
+ ->andReturn([]); // No service
+ }
+
+ /**
+ * Config works.
+ */
+ public function testConfig() {
+ $json = $this->get('/config')
+ ->response
+ ->getContent();
+
+ $this->assertJsonStringEqualsJsonFile(
+ __DIR__ . "/../../data/config.json",
+ $json
+ );
+ }
+
+}
diff --git a/tests/Console/Commands/TestCase.php b/tests/Console/Commands/TestCase.php
--- a/tests/Console/Commands/TestCase.php
+++ b/tests/Console/Commands/TestCase.php
@@ -58,25 +58,4 @@
return self::findInstanceOf($expectedType, Artisan::all());
}
- ///
- /// 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;
- }
-
}
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,23 @@
+{
+ "gates": [
+ "DockerHub",
+ "GitHub",
+ "Jenkins",
+ "Phabricator"
+ ],
+ "features": [
+ {
+ "name": "Gate",
+ "enabled": true
+ },
+ {
+ "name": "GetConfig",
+ "enabled": true
+ },
+ {
+ "name": "ActionsReport",
+ "enabled": true
+ }
+ ],
+ "services": []
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 7, 15:20 (20 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2180561
Default Alt Text
D789.id.diff (3 KB)

Event Timeline