public function test__invoke__TableNameAsConstructParam()
 {
     global $testCase;
     $testCase = 'default';
     $factoryClass = static::FACTORY_CLASS;
     $storeClass = static::STORE_CLASS;
     $this->container = (include './config/container.php');
     $this->object = new $factoryClass();
     $this->tableManagerMysql = $this->container->get(TableManagerMysql::KEY_IN_CONFIG);
     // if tables is absent
     $this->tableName = 'table_test_construct_param';
     $this->tableManagerMysql->deleteTable($this->tableName);
     $this->assertFalse($this->tableManagerMysql->hasTable($this->tableName));
     $store = $this->object->__invoke($this->container, '', [$factoryClass::KEY_TABLE_NAME => $this->tableName]);
     $this->assertInstanceOf($storeClass, $store);
     // if tables is present
     $this->assertTrue($this->tableManagerMysql->hasTable($this->tableName));
     $store = $this->object->__invoke($this->container, '', [$factoryClass::KEY_TABLE_NAME => $this->tableName]);
     $this->assertInstanceOf($storeClass, $store);
     $this->tableManagerMysql->deleteTable($this->tableName);
 }
示例#2
0
 /**
  * Retrieve new (not loaded) Store collection object with website filter
  *
  * @return \Magento\Store\Model\Resource\Store\Collection
  */
 public function getStoreCollection()
 {
     return $this->_storeFactory->create()->getCollection()->addWebsiteFilter($this->getId());
 }
 /**
  * @see SpecialPage::__construct
  *
  * @since 1.9
  *
  * @param $name
  * @param $restriction
  */
 public function __construct($name = '', $restriction = '')
 {
     parent::__construct($name, $restriction);
     $this->store = StoreFactory::getStore();
 }