public function testBuildThrowsExceptionUponInvalidClass() { try { Factory::build(array('id' => 1, 'name' => 'T-Shirt', 'type' => 'simpleconfigurable')); $failed = false; } catch (\Exception $ex) { $failed = true; } $this->assertTrue($failed, 'Factory sends exception when invalid type is used.'); }
public function loadProduct($id) { $data = $this->getProductArrayFromDbFor($id); return ProductFactory::build($data); }