/** * @magentoDataFixture Mage/Catalog/_files/products.php */ public function testLoadByAttribute() { $object = $this->_model->loadByAttribute('sku', 'simple'); $this->assertNotSame($object, $this->_model); $this->assertEquals(1, $object->getId()); // fixture $result = $this->_model->loadByAttribute('sku', uniqid()); // specifying wrong attribute code leads to fatal $this->assertFalse($result); }