getRelatedIds -> allRelatedIds

Create a running document of breaking changes
This commit is contained in:
Samuel Georges 2017-05-13 06:49:29 +10:00
parent 5f2f913732
commit bc23bc8fe6
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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'));
}
}