X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Ftests%2Fsrc%2FKernel%2FFieldBlockTest.php;h=aaeb4ca8115e28c4f64162c9c73a989ea0c6cd4d;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=d5246a0c2cd0342e65a1211f6f067b45f091009f;hpb=0bf8d09d2542548982e81a441b1f16e75873a04f;p=yaffs-website diff --git a/web/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php b/web/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php index d5246a0c2..aaeb4ca81 100644 --- a/web/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php +++ b/web/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php @@ -230,11 +230,10 @@ class FieldBlockTest extends EntityKernelTestBase { * @covers ::build * @dataProvider providerTestBuild */ - public function testBuild(PromiseInterface $promise, $in_preview, $expected_markup, $log_message = '', $log_arguments = []) { + public function testBuild(PromiseInterface $promise, $expected_markup, $log_message = '', $log_arguments = []) { $entity = $this->prophesize(FieldableEntityInterface::class); $field = $this->prophesize(FieldItemListInterface::class); $entity->get('the_field_name')->willReturn($field->reveal()); - $entity->in_preview = $in_preview; $field->view(Argument::type('array'))->will($promise); $field_definition = $this->prophesize(FieldDefinitionInterface::class); @@ -269,40 +268,20 @@ class FieldBlockTest extends EntityKernelTestBase { */ public function providerTestBuild() { $data = []; - $data['array, no preview'] = [ + $data['array'] = [ new ReturnPromise([['content' => ['#markup' => 'The field value']]]), - FALSE, - 'The field value', - ]; - $data['array, preview'] = [ - new ReturnPromise([['content' => ['#markup' => 'The field value']]]), - TRUE, 'The field value', ]; - $data['empty array, no preview'] = [ + $data['empty array'] = [ new ReturnPromise([[]]), - FALSE, '', ]; - $data['empty array, preview'] = [ - new ReturnPromise([[]]), - TRUE, - 'Placeholder for the "The Field Label" field', - ]; - $data['exception, no preview'] = [ + $data['exception'] = [ new ThrowPromise(new \Exception('The exception message')), - FALSE, '', 'The field "%field" failed to render with the error of "%error".', ['%field' => 'the_field_name', '%error' => 'The exception message'], ]; - $data['exception, preview'] = [ - new ThrowPromise(new \Exception('The exception message')), - TRUE, - 'Placeholder for the "The Field Label" field', - 'The field "%field" failed to render with the error of "%error".', - ['%field' => 'the_field_name', '%error' => 'The exception message'], - ]; return $data; }