Skip to content

Commit

Permalink
fix: separate test Head Serialize DataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Akbar Herlambang committed Oct 20, 2023
1 parent 833f335 commit ace4a5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/framework/rest/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ public function dataProviderSerializeDataProvider()
];
}

public function dataProviderHeadSerializeDataProvider()
{
return $this->dataProviderSerializeDataProvider();
}

/**
* @dataProvider dataProviderSerializeDataProvider
*
Expand All @@ -415,7 +420,17 @@ public function testSerializeDataProvider($dataProvider, $expectedResult, $saveK
$serializer->preserveKeys = $saveKeys;

$this->assertEquals($expectedResult, $serializer->serialize($dataProvider));
}

/**
* @dataProvider dataProviderHeadSerializeDataProvider
*
* @param \yii\data\DataProviderInterface $dataProvider
* @param array $expectedResult
* @param bool $saveKeys
*/
public function testHeadSerializeDataProvider($dataProvider, $expectedResult, $saveKeys = false)
{
$serializer = new Serializer();
$serializer->preserveKeys = $saveKeys;
$serializer->collectionEnvelope = 'data';
Expand Down

0 comments on commit ace4a5b

Please sign in to comment.