public function testSubCollections() { foreach ($this->collection->getTableNames() as $tableName) { $iterator = $this->collection->getTableIterator($tableName); $this->assertNotEmpty($iterator, $tableName); } }
public function testGetters() { $tableVos = $this->tableVoHydrator->createTableVos($this->definitionCollection->getTableNames()); $this->assertContainsOnlyInstancesOf('Shopware\\SwagDefaultSort\\Components\\DataAccess\\TableVo', $tableVos); $this->assertGreaterThan(0, count($tableVos)); foreach ($tableVos as $tableVo) { $this->assertNotEmpty($tableVo->getTableName()); } }
public function testGetters() { $shops = Shopware()->Models()->getRepository('Shopware\\Models\\Shop\\Shop')->findAll(); foreach ($shops as $shop) { Shopware()->Snippets()->setShop($shop); $filter = new TranslateFilterChain([new SimpleFilter(Shopware()->Snippets()->getNamespace('backend/swagdefaultsort/tables'))]); foreach ($this->definitionCollection->getTableNames() as $tableName) { $tableVo = new TableVo($tableName, $filter); $this->assertEquals($tableVo->getTableName(), $tableName); $json = json_encode($tableVo); $array = json_decode($json, true); $this->assertArrayHasKey('tableName', $array); $this->assertArrayHasKey('translation', $array); } } }
/** * @param RuleVo $vo * * @return AbstractSortDefinition */ private function loadDefinition(RuleVo $vo) { return $this->definitionCollection->getDefinition($vo->getDefinitionUid()); }