From bc23bc8fe63a67b41565694aece403aa33e37c9b Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 13 May 2017 06:49:29 +1000 Subject: [PATCH] getRelatedIds -> allRelatedIds Create a running document of breaking changes --- CHANGELOG.md | 9 +++++++++ tests/unit/plugins/database/BelongsToManyModelTest.php | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d38bebc5..a876485f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,10 @@ Changelog can be found here: http://octobercms.com/changelog + +### Breaking changes Laravel 5.5 + +- Database queries now return Collections instead of arrays! +- `pluck()` should be renamed to `value()` +- `getRelatedIds()` called from BelongsToMany is renamed to `allRelatedIds()` +- `Mail::pretend()` has been removed, use `Config::set('mail.driver', 'log');` instead + + diff --git a/tests/unit/plugins/database/BelongsToManyModelTest.php b/tests/unit/plugins/database/BelongsToManyModelTest.php index 5aef63778..8915eac11 100644 --- a/tests/unit/plugins/database/BelongsToManyModelTest.php +++ b/tests/unit/plugins/database/BelongsToManyModelTest.php @@ -102,7 +102,7 @@ class BelongsToManyModelTest extends PluginTestCase $this->assertEquals([$role1->id, $role2->id], $author->getRelationValue('roles')); // Get simple value (explicit) - $relatedIds = $author->roles()->getRelatedIds($sessionKey); + $relatedIds = $author->roles()->allRelatedIds($sessionKey)->all(); $this->assertEquals([$role1->id, $role2->id], $relatedIds); // Commit deferred @@ -162,5 +162,7 @@ class BelongsToManyModelTest extends PluginTestCase $author->roles()->add($role3, null, ['is_executive' => 0]); $this->assertEquals([1, 2], $author->executive_authors->lists('id')); + $this->assertEquals([1, 2], $author->executive_authors()->lists('id')); + $this->assertEquals([1, 2], $author->executive_authors()->get()->lists('id')); } }