public function testCreateWithoutOptions() { $this->resource->expects($this->once())->method('getModel')->will($this->returnValue($model = Fixture::class)); $fixture = $this->factory->create(); $this->assertInstanceOf($model, $fixture); $this->assertNull($fixture->getName()); }
/** * {@inheritdoc} */ public function create(array $options = []) { $translatable = parent::create($options); $translatable->setLocales($this->localeContext->getLocales()); $translatable->setFallbackLocale($this->localeContext->getFallbackLocale()); $translatable->setTranslationClass($this->resource->getTranslation()->getModel()); return $translatable; }
/** * {@inheritdoc} */ public function create(array $options = []) { return parent::create(array_merge($options, ['locales' => $this->localeContext->getLocales(), 'fallbackLocale' => $this->localeContext->getFallbackLocale(), 'translationFactory' => $this->translationFactory])); }
public function testCreate() { $this->resource->expects($this->once())->method('getModel')->will($this->returnValue($model = \stdClass::class)); $this->assertInstanceOf($model, $this->factory->create()); }