Example #1
0
 /**
  * Test a single attribute type mock.
  *
  * @param IAttributeFactory $factory          The factory to test.
  *
  * @param string            $attributeFactory The attribute type factory to test.
  *
  * @param bool              $shouldTranslated Flag if the attribute factory should say the type is translated.
  *
  * @param bool              $shouldSimple     Flag if the attribute factory should say the type is simple.
  *
  * @param bool              $shouldComplex    Flag if the attribute factory should say the type is complex.
  *
  * @return void
  */
 protected function mockFactoryTester($factory, $attributeFactory, $shouldTranslated, $shouldSimple, $shouldComplex)
 {
     $this->assertSame(true, $factory->attributeTypeMatchesFlags($attributeFactory, IAttributeFactory::FLAG_ALL), $attributeFactory . '.FLAG_ALL');
     $this->assertSame($shouldTranslated, $factory->attributeTypeMatchesFlags($attributeFactory, IAttributeFactory::FLAG_INCLUDE_TRANSLATED), $attributeFactory . '.FLAG_INCLUDE_TRANSLATED');
     $this->assertSame($shouldSimple, $factory->attributeTypeMatchesFlags($attributeFactory, IAttributeFactory::FLAG_INCLUDE_SIMPLE), $attributeFactory . '.FLAG_INCLUDE_SIMPLE');
     $this->assertSame($shouldComplex, $factory->attributeTypeMatchesFlags($attributeFactory, IAttributeFactory::FLAG_INCLUDE_COMPLEX), $attributeFactory . '.FLAG_INCLUDE_COMPLEX');
 }
 /**
  * Set the factory to use.
  *
  * @param IAttributeFactory $factory The factory in use.
  *
  * @return MetaModelsServiceContainer
  */
 public function setAttributeFactory(IAttributeFactory $factory)
 {
     $this->attributeFactory = $factory;
     $factory->setServiceContainer($this);
     return $this;
 }