1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

Rename ApiSerializer's mutate to attributes (#2578)

This commit is contained in:
Sami Mazouz
2021-02-05 19:21:36 +01:00
committed by GitHub
parent 2a2abfb3fa
commit b1efe7b133
4 changed files with 47 additions and 25 deletions

View File

@@ -74,7 +74,7 @@ class ApiSerializerTest extends TestCase
{
$this->extend(
(new Extend\ApiSerializer(ForumSerializer::class))
->mutate(function () {
->attributes(function () {
return [
'customAttribute' => true
];
@@ -101,7 +101,7 @@ class ApiSerializerTest extends TestCase
{
$this->extend(
(new Extend\ApiSerializer(ForumSerializer::class))
->mutate(CustomAttributesInvokableClass::class)
->attributes(CustomAttributesInvokableClass::class)
);
$this->app();
@@ -124,7 +124,7 @@ class ApiSerializerTest extends TestCase
{
$this->extend(
(new Extend\ApiSerializer(BasicUserSerializer::class))
->mutate(function () {
->attributes(function () {
return [
'customAttribute' => true
];
@@ -151,13 +151,13 @@ class ApiSerializerTest extends TestCase
{
$this->extend(
(new Extend\ApiSerializer(BasicUserSerializer::class))
->mutate(function () {
->attributes(function () {
return [
'customAttribute' => 'initialValue'
];
}),
(new Extend\ApiSerializer(UserSerializer::class))
->mutate(function () {
->attributes(function () {
return [
'customAttribute' => 'newValue'
];
@@ -294,7 +294,7 @@ class ApiSerializerTest extends TestCase
(new Extend\ApiSerializer(BasicUserSerializer::class))
->attribute('someCustomAttribute', function () {
return 'newValue';
})->mutate(function () {
})->attributes(function () {
return [
'someCustomAttribute' => 'initialValue',
'someOtherCustomAttribute' => 'initialValue',