From 2c707588fff912ffb34ead08ce694d8f41ff5a85 Mon Sep 17 00:00:00 2001 From: Georgi Hristov Date: Thu, 6 Aug 2020 11:18:12 +0200 Subject: [PATCH] [update] use field filter constants in tests --- tests/FieldTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/FieldTest.php b/tests/FieldTest.php index a626bf3c26..e5d5d01a59 100644 --- a/tests/FieldTest.php +++ b/tests/FieldTest.php @@ -781,11 +781,11 @@ public function testGetFields() $model->addField('not_editable', ['ui' => ['editable' => false]]); $this->assertSame(['system', 'editable', 'editable_system', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields())); - $this->assertSame(['system', 'editable_system', 'visible_system'], array_keys($model->getFields('system'))); - $this->assertSame(['editable', 'visible', 'not_editable'], array_keys($model->getFields('not system'))); - $this->assertSame(['editable', 'editable_system', 'visible'], array_keys($model->getFields('editable'))); - $this->assertSame(['editable', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields('visible'))); - $this->assertSame(['editable', 'editable_system', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields(['editable', 'visible']))); + $this->assertSame(['system', 'editable_system', 'visible_system'], array_keys($model->getFields(Model::FIELD_FILTER_SYSTEM))); + $this->assertSame(['editable', 'visible', 'not_editable'], array_keys($model->getFields(Model::FIELD_FILTER_NOT_SYSTEM))); + $this->assertSame(['editable', 'editable_system', 'visible'], array_keys($model->getFields(Model::FIELD_FILTER_EDITABLE))); + $this->assertSame(['editable', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields(Model::FIELD_FILTER_VISIBLE))); + $this->assertSame(['editable', 'editable_system', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields([Model::FIELD_FILTER_EDITABLE, Model::FIELD_FILTER_VISIBLE]))); $model->onlyFields(['system', 'visible', 'not_editable']); @@ -793,7 +793,7 @@ public function testGetFields() $this->assertSame(['system', 'editable', 'editable_system', 'visible', 'visible_system', 'not_editable'], array_keys($model->getFields())); // only return subset of only_fields - $this->assertSame(['visible', 'not_editable'], array_keys($model->getFields('visible'))); + $this->assertSame(['visible', 'not_editable'], array_keys($model->getFields(Model::FIELD_FILTER_VISIBLE))); $this->expectExceptionMessage('not supported'); $model->getFields('foo');