Skip to content

Commit

Permalink
EZP-24274: implemented Checkbox search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Apr 30, 2015
1 parent 655f489 commit f915df8
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion Repository/Tests/FieldType/CheckboxIntegrationTest.php
Expand Up @@ -18,7 +18,7 @@
* @group integration
* @group field-type
*/
class CheckboxIntegrationTest extends BaseIntegrationTest
class CheckboxIntegrationTest extends SearchBaseIntegrationTest
{
/**
* Get name of tested field type
Expand Down Expand Up @@ -311,4 +311,36 @@ public function providerForTestIsNotEmptyValue()
),
);
}

protected function getValidSearchValueOne()
{
return false;
}

protected function getValidSearchValueTwo()
{
return true;
}

protected function getSearchTargetValueOne()
{
// Handling Legacy Search Engine, which stores Checkbox value as integer
if ( ltrim( get_class( $this->getSetupFactory() ), '\\' ) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
{
return (int)$this->getValidSearchValueOne();
}

return parent::getSearchTargetValueOne();
}

protected function getSearchTargetValueTwo()
{
// Handling Legacy Search Engine, which stores Checkbox value as integer
if ( ltrim( get_class( $this->getSetupFactory() ), '\\' ) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
{
return (int)$this->getValidSearchValueTwo();
}

return parent::getSearchTargetValueTwo();
}
}

0 comments on commit f915df8

Please sign in to comment.