Ejemplo n.º 1
0
 public function testGetFlatUpdateSelect()
 {
     $store = 1;
     $select = 'select';
     $this->option->expects($this->once())->method('getFlatUpdateSelect')->with($this->attribute, $store, false)->will($this->returnValue($select));
     $this->assertEquals($select, $this->model->getFlatUpdateSelect($store));
 }
Ejemplo n.º 2
0
 public function testGetFlatColums()
 {
     $abstractAttributeMock = $this->getMock('\\Magento\\Eav\\Model\\Entity\\Attribute\\AbstractAttribute', array('getAttributeCode', '__wakeup'), array(), '', false);
     $abstractAttributeMock->expects($this->any())->method('getAttributeCode')->will($this->returnValue('code'));
     $this->_model->setAttribute($abstractAttributeMock);
     $flatColums = $this->_model->getFlatColums();
     $this->assertTrue(is_array($flatColums), 'FlatColums must be an array value');
     $this->assertTrue(!empty($flatColums), 'FlatColums must be not empty');
     foreach ($flatColums as $result) {
         $this->assertArrayHasKey('unsigned', $result, 'FlatColums must have "unsigned" column');
         $this->assertArrayHasKey('default', $result, 'FlatColums must have "default" column');
         $this->assertArrayHasKey('extra', $result, 'FlatColums must have "extra" column');
         $this->assertArrayHasKey('type', $result, 'FlatColums must have "type" column');
         $this->assertArrayHasKey('nullable', $result, 'FlatColums must have "nullable" column');
         $this->assertArrayHasKey('comment', $result, 'FlatColums must have "comment" column');
     }
 }