getContainer(); $this->cfHelper = $container->get('chill.custom_field.helper'); $this->randomCFText = (new CustomField()) ->setSlug('my-slug') ->setActive(true) ->setName(['fr' => 'my cf']) ->setOptions(['maxLength' => 1000]) ->setType('text'); } public function testIsEmptyValue() { // not empty value $data = [ $this->randomCFText->getSlug() => 'Sample text', ]; $this->assertFalse($this->cfHelper->isEmptyValue($data, $this->randomCFText)); // empty value $data = [ $this->randomCFText->getSlug() => '', ]; $this->assertTrue($this->cfHelper->isEmptyValue($data, $this->randomCFText)); } public function testRenderCustomField() { $data = [ $this->randomCFText->getSlug() => 'Sample text', ]; $text = $this->cfHelper->renderCustomField($data, $this->randomCFText); $this->assertContains('Sample text', $text); } }