consistency in twig methods

The method chill_custom_fields_is_empty take now the fields as first argument, and the customField as second argument, to be consistent with other twig methods.
This commit is contained in:
2015-12-28 00:54:38 +01:00
parent d2039893b3
commit 54391b02f3
3 changed files with 25 additions and 2 deletions

View File

@@ -102,4 +102,27 @@ class CustomFieldRenderingTwigTest extends KernelTestCase
$this->assertContains('My tailor is rich', $text,
"The rendering text should contains the 'test' text");
}
public function testIsEmpty()
{
$cf = $this->getSimpleCustomFieldText();
// value is not empty
$fields = array(
'test' => "My tailor is rich"
);
$result = $this->cfRendering->isEmptyValue($fields, $cf);
$this->assertFalse($result);
// value is empty
$fields = array(
'text' => ''
);
$result = $this->cfRendering->isEmptyValue($fields, $cf);
$this->assertTrue($result);
}
}