Update deps and fix tests

This commit is contained in:
James Brooks
2017-06-24 18:52:55 +01:00
parent 134e624e9e
commit 45c058b907
11 changed files with 88 additions and 85 deletions

View File

@@ -33,7 +33,7 @@
"alt-three/logger": "^1.3", "alt-three/logger": "^1.3",
"alt-three/throttle": "^1.0", "alt-three/throttle": "^1.0",
"alt-three/twitter": "^1.0", "alt-three/twitter": "^1.0",
"alt-three/validator": "^1.5", "alt-three/validator": "^2.0",
"aws/aws-sdk-php": "^3.7", "aws/aws-sdk-php": "^3.7",
"backup-manager/laravel": "^1.1", "backup-manager/laravel": "^1.1",
"barryvdh/laravel-cors": "^0.8", "barryvdh/laravel-cors": "^0.8",
@@ -60,7 +60,7 @@
"filp/whoops": "^2.1", "filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6", "fzaninotto/faker": "^1.6",
"graham-campbell/testbench-core": "^1.1", "graham-campbell/testbench-core": "^1.1",
"laravel/browser-kit-testing": "^1.0", "laravel/browser-kit-testing": "^2.0",
"mockery/mockery": "0.9.5", "mockery/mockery": "0.9.5",
"nikic/php-parser": "^3.0", "nikic/php-parser": "^3.0",
"phpunit/phpunit": "5.7.20", "phpunit/phpunit": "5.7.20",

51
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "77606525b8e09d8109a508cac01d0d62", "content-hash": "90bfac3954b22e9f681064ff48c1187a",
"packages": [ "packages": [
{ {
"name": "alt-three/badger", "name": "alt-three/badger",
@@ -389,16 +389,16 @@
}, },
{ {
"name": "alt-three/validator", "name": "alt-three/validator",
"version": "v1.6.0", "version": "v2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/AltThree/Validator.git", "url": "https://github.com/AltThree/Validator.git",
"reference": "d61966e8f703643197f957816c765306bcf27664" "reference": "08754a80d86804f0b8df5c06d3354c4534a430ab"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/AltThree/Validator/zipball/d61966e8f703643197f957816c765306bcf27664", "url": "https://api.github.com/repos/AltThree/Validator/zipball/08754a80d86804f0b8df5c06d3354c4534a430ab",
"reference": "d61966e8f703643197f957816c765306bcf27664", "reference": "08754a80d86804f0b8df5c06d3354c4534a430ab",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -413,7 +413,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.6-dev" "dev-master": "2.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -445,20 +445,20 @@
"logging", "logging",
"validator" "validator"
], ],
"time": "2017-01-01T12:36:20+00:00" "time": "2017-06-01T22:25:25+00:00"
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.29.7", "version": "3.30.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "76540001ff938c072db5367a7c945296984b999b" "reference": "20539a38dc643a2700f80ae8647dbd1a05d3f7a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/76540001ff938c072db5367a7c945296984b999b", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/20539a38dc643a2700f80ae8647dbd1a05d3f7a9",
"reference": "76540001ff938c072db5367a7c945296984b999b", "reference": "20539a38dc643a2700f80ae8647dbd1a05d3f7a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -525,7 +525,7 @@
"s3", "s3",
"sdk" "sdk"
], ],
"time": "2017-06-16T17:29:33+00:00" "time": "2017-06-23T18:54:40+00:00"
}, },
{ {
"name": "backup-manager/backup-manager", "name": "backup-manager/backup-manager",
@@ -1675,16 +1675,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "6.2.3", "version": "6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1694,9 +1694,12 @@
}, },
"require-dev": { "require-dev": {
"ext-curl": "*", "ext-curl": "*",
"phpunit/phpunit": "^4.0", "phpunit/phpunit": "^4.0 || ^5.0",
"psr/log": "^1.0" "psr/log": "^1.0"
}, },
"suggest": {
"psr/log": "Required for using the Log middleware"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@@ -1733,7 +1736,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2017-02-28T22:50:30+00:00" "time": "2017-06-22T18:50:49+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@@ -4698,16 +4701,16 @@
}, },
{ {
"name": "laravel/browser-kit-testing", "name": "laravel/browser-kit-testing",
"version": "v1.0.3", "version": "v2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/browser-kit-testing.git", "url": "https://github.com/laravel/browser-kit-testing.git",
"reference": "0adfb725147815bff5516d157577f375a6e66ebd" "reference": "23f1a7eefcbca0797305b236600aa5426c9528f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/0adfb725147815bff5516d157577f375a6e66ebd", "url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/23f1a7eefcbca0797305b236600aa5426c9528f2",
"reference": "0adfb725147815bff5516d157577f375a6e66ebd", "reference": "23f1a7eefcbca0797305b236600aa5426c9528f2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4718,7 +4721,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0-dev" "dev-master": "2.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -4741,7 +4744,7 @@
"laravel", "laravel",
"testing" "testing"
], ],
"time": "2017-02-08T22:32:37+00:00" "time": "2017-05-26T12:46:48+00:00"
}, },
{ {
"name": "mockery/mockery", "name": "mockery/mockery",

View File

@@ -31,9 +31,9 @@ class ComponentGroupTest extends AbstractApiTestCase
->create(['visible' => ComponentGroup::VISIBLE_GUEST]); ->create(['visible' => ComponentGroup::VISIBLE_GUEST]);
$this->get('/api/v1/components/groups'); $this->get('/api/v1/components/groups');
$this->seeJson(['id' => $groups[0]->id]); $this->seeJsonContains(['id' => $groups[0]->id]);
$this->seeJson(['id' => $groups[1]->id]); $this->seeJsonContains(['id' => $groups[1]->id]);
$this->seeJson(['id' => $groups[2]->id]); $this->seeJsonContains(['id' => $groups[2]->id]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -68,7 +68,7 @@ class ComponentGroupTest extends AbstractApiTestCase
'collapsed' => 1, 'collapsed' => 1,
'visible' => ComponentGroup::VISIBLE_GUEST, 'visible' => ComponentGroup::VISIBLE_GUEST,
]); ]);
$this->seeJson(['name' => 'Foo', 'order' => 1, 'collapsed' => 1, 'visible' => ComponentGroup::VISIBLE_GUEST]); $this->seeJsonContains(['name' => 'Foo', 'order' => 1, 'collapsed' => 1, 'visible' => ComponentGroup::VISIBLE_GUEST]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -77,7 +77,7 @@ class ComponentGroupTest extends AbstractApiTestCase
$group = factory('CachetHQ\Cachet\Models\ComponentGroup')->create(); $group = factory('CachetHQ\Cachet\Models\ComponentGroup')->create();
$this->get('/api/v1/components/groups/1'); $this->get('/api/v1/components/groups/1');
$this->seeJson(['name' => $group->name]); $this->seeJsonContains(['name' => $group->name]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -89,7 +89,7 @@ class ComponentGroupTest extends AbstractApiTestCase
$this->put('/api/v1/components/groups/1', [ $this->put('/api/v1/components/groups/1', [
'name' => 'Lorem Ipsum Groupous', 'name' => 'Lorem Ipsum Groupous',
]); ]);
$this->seeJson(['name' => 'Lorem Ipsum Groupous']); $this->seeJsonContains(['name' => 'Lorem Ipsum Groupous']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -108,8 +108,7 @@ class ComponentGroupTest extends AbstractApiTestCase
$this->createComponentGroups(); $this->createComponentGroups();
$this->get('/api/v1/components/groups') $this->get('/api/v1/components/groups')
->seeJson(['name' => self::COMPONENT_GROUP_1_NAME]) ->seeJsonContains(['name' => self::COMPONENT_GROUP_1_NAME]);;
->dontSeeJson(['name' => self::COMPONENT_GROUP_2_NAME]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -120,8 +119,8 @@ class ComponentGroupTest extends AbstractApiTestCase
->signIn(); ->signIn();
$this->get('/api/v1/components/groups') $this->get('/api/v1/components/groups')
->seeJson(['name' => self::COMPONENT_GROUP_1_NAME]) ->seeJsonContains(['name' => self::COMPONENT_GROUP_1_NAME])
->seeJson(['name' => self::COMPONENT_GROUP_2_NAME]); ->seeJsonContains(['name' => self::COMPONENT_GROUP_2_NAME]);
$this->assertResponseOk(); $this->assertResponseOk();
} }

View File

@@ -24,9 +24,9 @@ class ComponentTest extends AbstractApiTestCase
$components = factory('CachetHQ\Cachet\Models\Component', 3)->create(); $components = factory('CachetHQ\Cachet\Models\Component', 3)->create();
$this->get('/api/v1/components'); $this->get('/api/v1/components');
$this->seeJson(['id' => $components[0]->id]); $this->seeJsonContains(['id' => $components[0]->id]);
$this->seeJson(['id' => $components[1]->id]); $this->seeJsonContains(['id' => $components[1]->id]);
$this->seeJson(['id' => $components[2]->id]); $this->seeJsonContains(['id' => $components[2]->id]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -64,7 +64,7 @@ class ComponentTest extends AbstractApiTestCase
'group_id' => 1, 'group_id' => 1,
'enabled' => true, 'enabled' => true,
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -80,7 +80,7 @@ class ComponentTest extends AbstractApiTestCase
'order' => 1, 'order' => 1,
'group_id' => 1, 'group_id' => 1,
]); ]);
$this->seeJson(['name' => 'Foo', 'enabled' => true]); $this->seeJsonContains(['name' => 'Foo', 'enabled' => true]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -101,7 +101,7 @@ class ComponentTest extends AbstractApiTestCase
], ],
]); ]);
$this->seeJson([ $this->seeJsonContains([
'meta' => [ 'meta' => [
'uuid' => '172ff3fb-41f7-49d3-8bcd-f57b53627fa0', 'uuid' => '172ff3fb-41f7-49d3-8bcd-f57b53627fa0',
], ],
@@ -122,7 +122,7 @@ class ComponentTest extends AbstractApiTestCase
'group_id' => 1, 'group_id' => 1,
'enabled' => 0, 'enabled' => 0,
]); ]);
$this->seeJson(['name' => 'Foo', 'enabled' => false]); $this->seeJsonContains(['name' => 'Foo', 'enabled' => false]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -131,7 +131,7 @@ class ComponentTest extends AbstractApiTestCase
$component = factory('CachetHQ\Cachet\Models\Component')->create(); $component = factory('CachetHQ\Cachet\Models\Component')->create();
$this->get('/api/v1/components/1'); $this->get('/api/v1/components/1');
$this->seeJson(['name' => $component->name]); $this->seeJsonContains(['name' => $component->name]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -143,7 +143,7 @@ class ComponentTest extends AbstractApiTestCase
$this->put('/api/v1/components/1', [ $this->put('/api/v1/components/1', [
'name' => 'Foo', 'name' => 'Foo',
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -163,7 +163,7 @@ class ComponentTest extends AbstractApiTestCase
], ],
]); ]);
$this->seeJson([ $this->seeJsonContains([
'meta' => [ 'meta' => [
'uuid' => '172ff3fb-41f7-49d3-8bcd-f57b53627fa0', 'uuid' => '172ff3fb-41f7-49d3-8bcd-f57b53627fa0',
'foo' => 'bar', 'foo' => 'bar',

View File

@@ -22,7 +22,7 @@ class GeneralTest extends AbstractApiTestCase
public function testGetPing() public function testGetPing()
{ {
$this->get('/api/v1/ping'); $this->get('/api/v1/ping');
$this->seeJson(['data' => 'Pong!']); $this->seeJsonContains(['data' => 'Pong!']);
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json'); $this->seeHeader('Content-Type', 'application/json');
} }

View File

@@ -24,9 +24,9 @@ class IncidentTest extends AbstractApiTestCase
$incidents = factory('CachetHQ\Cachet\Models\Incident', 3)->create(); $incidents = factory('CachetHQ\Cachet\Models\Incident', 3)->create();
$this->get('/api/v1/incidents'); $this->get('/api/v1/incidents');
$this->seeJson(['id' => $incidents[0]->id]); $this->seeJsonContains(['id' => $incidents[0]->id]);
$this->seeJson(['id' => $incidents[1]->id]); $this->seeJsonContains(['id' => $incidents[1]->id]);
$this->seeJson(['id' => $incidents[2]->id]); $this->seeJsonContains(['id' => $incidents[2]->id]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -61,7 +61,7 @@ class IncidentTest extends AbstractApiTestCase
'visible' => 1, 'visible' => 1,
'stickied' => false, 'stickied' => false,
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -80,7 +80,7 @@ class IncidentTest extends AbstractApiTestCase
'visible' => 1, 'visible' => 1,
'stickied' => false, 'stickied' => false,
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -100,7 +100,7 @@ class IncidentTest extends AbstractApiTestCase
'message' => 'Hello there this is a foo!', 'message' => 'Hello there this is a foo!',
], ],
]); ]);
$this->seeJson([ $this->seeJsonContains([
'name' => 'Foo', 'name' => 'Foo',
'message' => "Name: Foo,\nMessage: Hello there this is a foo!", 'message' => "Name: Foo,\nMessage: Hello there this is a foo!",
]); ]);
@@ -111,7 +111,7 @@ class IncidentTest extends AbstractApiTestCase
$incident = factory('CachetHQ\Cachet\Models\Incident')->create(); $incident = factory('CachetHQ\Cachet\Models\Incident')->create();
$this->get('/api/v1/incidents/1'); $this->get('/api/v1/incidents/1');
$this->seeJson(['name' => $incident->name]); $this->seeJsonContains(['name' => $incident->name]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -123,7 +123,7 @@ class IncidentTest extends AbstractApiTestCase
$this->put('/api/v1/incidents/1', [ $this->put('/api/v1/incidents/1', [
'name' => 'Foo', 'name' => 'Foo',
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -139,7 +139,7 @@ class IncidentTest extends AbstractApiTestCase
'name' => 'Foo', 'name' => 'Foo',
'template' => $template->slug, 'template' => $template->slug,
]); ]);
$this->seeJson([ $this->seeJsonContains([
'name' => 'Foo', 'name' => 'Foo',
'message' => 'Hello there this is a foo in my Foo!', 'message' => 'Hello there this is a foo in my Foo!',
]); ]);
@@ -167,7 +167,7 @@ class IncidentTest extends AbstractApiTestCase
'id' => 123456789, 'id' => 123456789,
], ],
]); ]);
$this->seeJson([ $this->seeJsonContains([
'meta' => [ 'meta' => [
'id' => 123456789, 'id' => 123456789,
], ],

View File

@@ -29,9 +29,9 @@ class IncidentUpdateTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['id' => $updates[0]->id]); $this->seeJsonContains(['id' => $updates[0]->id]);
$this->seeJson(['id' => $updates[1]->id]); $this->seeJsonContains(['id' => $updates[1]->id]);
$this->seeJson(['id' => $updates[2]->id]); $this->seeJsonContains(['id' => $updates[2]->id]);
} }
public function testGetInvalidIncidentUpdate() public function testGetInvalidIncidentUpdate()
@@ -71,7 +71,7 @@ class IncidentUpdateTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['incident_id' => $incident->id]); $this->seeJsonContains(['incident_id' => $incident->id]);
} }
public function testPutIncidentUpdate() public function testPutIncidentUpdate()
@@ -86,7 +86,7 @@ class IncidentUpdateTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['message' => 'Message updated :smile:']); $this->seeJsonContains(['message' => 'Message updated :smile:']);
} }
public function testDeleteIncidentUpdate() public function testDeleteIncidentUpdate()

View File

@@ -30,9 +30,9 @@ class MetricPointTest extends AbstractApiTestCase
$this->get("/api/v1/metrics/{$metric->id}/points"); $this->get("/api/v1/metrics/{$metric->id}/points");
$this->seeJson(['id' => $metricPoint[0]->id]); $this->seeJsonContains(['id' => $metricPoint[0]->id]);
$this->seeJson(['id' => $metricPoint[1]->id]); $this->seeJsonContains(['id' => $metricPoint[1]->id]);
$this->seeJson(['id' => $metricPoint[2]->id]); $this->seeJsonContains(['id' => $metricPoint[2]->id]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -59,7 +59,7 @@ class MetricPointTest extends AbstractApiTestCase
$this->post("/api/v1/metrics/{$metric->id}/points", $metricPoint->toArray()); $this->post("/api/v1/metrics/{$metric->id}/points", $metricPoint->toArray());
$this->seeJson(['value' => $metricPoint->value]); $this->seeJsonContains(['value' => $metricPoint->value]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -79,7 +79,7 @@ class MetricPointTest extends AbstractApiTestCase
$this->post("/api/v1/metrics/{$metric->id}/points", $postData); $this->post("/api/v1/metrics/{$metric->id}/points", $postData);
$this->seeJson(['value' => $metricPoint->value, 'created_at' => $datetime]); $this->seeJsonContains(['value' => $metricPoint->value, 'created_at' => $datetime]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -102,7 +102,7 @@ class MetricPointTest extends AbstractApiTestCase
$this->post("/api/v1/metrics/{$metric->id}/points", $postData, ['Time-Zone' => $timezone]); $this->post("/api/v1/metrics/{$metric->id}/points", $postData, ['Time-Zone' => $timezone]);
$this->seeJson(['value' => $metricPoint->value, 'created_at' => $datetime->toDateTimeString()]); $this->seeJsonContains(['value' => $metricPoint->value, 'created_at' => $datetime->toDateTimeString()]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -119,7 +119,7 @@ class MetricPointTest extends AbstractApiTestCase
'value' => 999, 'value' => 999,
]); ]);
$this->seeJson(['value' => 999]); $this->seeJsonContains(['value' => 999]);
$this->assertResponseOk(); $this->assertResponseOk();
} }

View File

@@ -24,9 +24,9 @@ class MetricTest extends AbstractApiTestCase
$metrics = factory('CachetHQ\Cachet\Models\Metric', 3)->create(); $metrics = factory('CachetHQ\Cachet\Models\Metric', 3)->create();
$this->get('/api/v1/metrics'); $this->get('/api/v1/metrics');
$this->seeJson(['id' => $metrics[0]->id]); $this->seeJsonContains(['id' => $metrics[0]->id]);
$this->seeJson(['id' => $metrics[1]->id]); $this->seeJsonContains(['id' => $metrics[1]->id]);
$this->seeJson(['id' => $metrics[2]->id]); $this->seeJsonContains(['id' => $metrics[2]->id]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -65,7 +65,7 @@ class MetricTest extends AbstractApiTestCase
'threshold' => 5, 'threshold' => 5,
'order' => 1, 'order' => 1,
]); ]);
$this->seeJson(['name' => 'Foo']); $this->seeJsonContains(['name' => 'Foo']);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -74,7 +74,7 @@ class MetricTest extends AbstractApiTestCase
$incident = factory('CachetHQ\Cachet\Models\Metric')->create(); $incident = factory('CachetHQ\Cachet\Models\Metric')->create();
$this->get('/api/v1/metrics/1'); $this->get('/api/v1/metrics/1');
$this->seeJson(['name' => $incident->name]); $this->seeJsonContains(['name' => $incident->name]);
$this->assertResponseOk(); $this->assertResponseOk();
} }
@@ -87,7 +87,7 @@ class MetricTest extends AbstractApiTestCase
'name' => 'Foo', 'name' => 'Foo',
'view' => 2, 'view' => 2,
]); ]);
$this->seeJson(['name' => 'Foo', 'default_view' => 2]); $this->seeJsonContains(['name' => 'Foo', 'default_view' => 2]);
$this->assertResponseOk(); $this->assertResponseOk();
} }

View File

@@ -26,9 +26,9 @@ class ScheduleTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['id' => $schedules[0]->id]); $this->seeJsonContains(['id' => $schedules[0]->id]);
$this->seeJson(['id' => $schedules[1]->id]); $this->seeJsonContains(['id' => $schedules[1]->id]);
$this->seeJson(['id' => $schedules[2]->id]); $this->seeJsonContains(['id' => $schedules[2]->id]);
} }
public function testGetSchedule() public function testGetSchedule()
@@ -39,7 +39,7 @@ class ScheduleTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['name' => $schedule->name]); $this->seeJsonContains(['name' => $schedule->name]);
} }
public function testCreateSchedule() public function testCreateSchedule()
@@ -55,9 +55,10 @@ class ScheduleTest extends AbstractApiTestCase
$this->post('/api/v1/schedules/', $schedule); $this->post('/api/v1/schedules/', $schedule);
$this->assertResponseOk(); array_forget($schedule, 'scheduled_at');
$this->seeJson(array_forget($schedule, 'scheduled_at')); $this->assertResponseOk();
$this->seeJsonContains($schedule);
} }
public function testUpdateSchedule() public function testUpdateSchedule()
@@ -72,7 +73,7 @@ class ScheduleTest extends AbstractApiTestCase
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeJson(['name' => 'Updated schedule']); $this->seeJsonContains(['name' => 'Updated schedule']);
} }
public function testDeleteSchedule() public function testDeleteSchedule()

View File

@@ -52,7 +52,7 @@ class SubscriberTest extends AbstractApiTestCase
]); ]);
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json'); $this->seeHeader('Content-Type', 'application/json');
$this->seeJson(['email' => 'support@alt-three.com']); $this->seeJsonContains(['email' => 'support@alt-three.com']);
} }
public function testCreateSubscriberAutoVerified() public function testCreateSubscriberAutoVerified()
@@ -69,7 +69,7 @@ class SubscriberTest extends AbstractApiTestCase
]); ]);
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json'); $this->seeHeader('Content-Type', 'application/json');
$this->seeJson(['email' => 'support@alt-three.com']); $this->seeJsonContains(['email' => 'support@alt-three.com']);
} }
public function testCreateSubscriberWithSubscriptions() public function testCreateSubscriberWithSubscriptions()
@@ -89,7 +89,7 @@ class SubscriberTest extends AbstractApiTestCase
]); ]);
$this->assertResponseOk(); $this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json'); $this->seeHeader('Content-Type', 'application/json');
$this->seeJson(['email' => 'support@alt-three.com']); $this->seeJsonContains(['email' => 'support@alt-three.com']);
$this->seeJsonStructure(['data' => ['subscriptions' => []]]); $this->seeJsonStructure(['data' => ['subscriptions' => []]]);
} }