Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3748500
D789.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D789.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 09:12 (4 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249059
Default Alt Text
D789.diff (3 KB)
Attached To
Mode
D789: Integration test for ConfigReport
Attached
Detach File
Event Timeline
Log In to Comment