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