/** * Test that an exception is thrown when the attribute does not implement ISimple but we want to filter on time. * * @return void */ public function testTimeRaisesExceptionForNonSimpleAttribute() { $attribute = $this->getMockForAbstractClass('\\MetaModels\\Attribute\\IAttribute', array($this->mockMetaModel(), array())); $rule = new FromToDate($attribute); $rule->setDateType('time')->setLowerBound(10, true)->setUpperBound(20, true); $this->setExpectedException('RuntimeException'); $rule->getMatchingIds(); }
/** * {@inheritDoc} */ protected function buildFromToRule($attribute) { $rule = new FromToRule($attribute); $rule->setDateType($this->get('timetype')); return $rule; }