function SerializerTest::setUp
Same name in this branch
- 10 core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php \Drupal\Tests\jsonapi\Kernel\Serializer\SerializerTest::setUp()
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php \Drupal\Tests\jsonapi\Kernel\Serializer\SerializerTest::setUp()
- 9 core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php \Drupal\Tests\rest\Unit\Plugin\views\style\SerializerTest::setUp()
- 8.9.x core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php \Drupal\Tests\jsonapi\Kernel\Serializer\SerializerTest::setUp()
- 8.9.x core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php \Drupal\Tests\rest\Unit\Plugin\views\style\SerializerTest::setUp()
- 11.x core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php \Drupal\Tests\jsonapi\Kernel\Serializer\SerializerTest::setUp()
- 11.x core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php \Drupal\Tests\rest\Unit\Plugin\views\style\SerializerTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ rest/ tests/ src/ Unit/ Plugin/ views/ style/ SerializerTest.php, line 37
Class
- SerializerTest
- @coversDefaultClass \Drupal\rest\Plugin\views\style\Serializer @group rest
Namespace
Drupal\Tests\rest\Unit\Plugin\views\styleCode
protected function setUp() : void {
parent::setUp();
$this->view = $this->getMockBuilder(ViewExecutable::class)
->disableOriginalConstructor()
->getMock();
// Make the view result empty so we don't have to mock the row plugin render
// call.
$this->view->result = [];
$this->displayHandler = $this->getMockBuilder(RestExport::class)
->disableOriginalConstructor()
->getMock();
$this->displayHandler
->expects($this->any())
->method('getContentType')
->willReturn('json');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.