コード例 #1
0
 /**
  * @return void
  */
 public function setUp()
 {
     $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $this->resource = $this->objectManager->get('Magento\\Framework\\App\\ResourceConnection');
     $this->connection = $this->resource->getConnection();
     $this->model = $this->objectManager->create('Magento\\Framework\\Mview\\View\\Changelog', ['resource' => $this->resource]);
     $this->model->setViewId('test_view_id_1');
     $this->model->create();
 }
コード例 #2
0
 public function testCreateWithException()
 {
     $changelogTableName = 'viewIdtest_cl';
     $this->mockIsTableExists($changelogTableName, true);
     $this->mockGetTableName();
     $this->setExpectedException('Exception', "Table {$changelogTableName} already exist");
     $this->model->setViewId('viewIdtest');
     $this->model->create();
 }
コード例 #3
0
 public function testCreateWithExistingTable()
 {
     $changelogTableName = 'viewIdtest_cl';
     $this->mockIsTableExists($changelogTableName, true);
     $this->mockGetTableName();
     $this->connectionMock->expects($this->never())->method('createTable');
     $this->model->setViewId('viewIdtest');
     $this->model->create();
 }