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.');
 }
示例#2
0
 public function loadProduct($id)
 {
     $data = $this->getProductArrayFromDbFor($id);
     return ProductFactory::build($data);
 }