예제 #1
0
 /**
  * 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();
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 protected function buildFromToRule($attribute)
 {
     $rule = new FromToRule($attribute);
     $rule->setDateType($this->get('timetype'));
     return $rule;
 }