示例#1
0
 public function testCanUseAttribute()
 {
     $attribute = $this->getMock('Magento\\Catalog\\Model\\Resource\\Eav\\Attribute', ['getIsGlobal', 'getIsVisible', 'usesSource', 'getIsUserDefined', '__wakeup', '__sleep'], [], '', false);
     $attribute->expects($this->once())->method('getIsGlobal')->will($this->returnValue(1));
     $attribute->expects($this->once())->method('getIsVisible')->will($this->returnValue(1));
     $attribute->expects($this->once())->method('usesSource')->will($this->returnValue(1));
     $attribute->expects($this->once())->method('getIsUserDefined')->will($this->returnValue(1));
     $this->assertTrue($this->_model->canUseAttribute($attribute));
 }