Example #1
0
 /**
  * @expectedException Exception
  */
 public function testMissingSubActionForeignSchem()
 {
     $tmpfile = tempnam('/tmp', 'test_image_');
     copy('tests/data/404.png', $tmpfile);
     $files = ['images' => CreateFilesArrayWithAssociateKey(['a' => ['image' => CreateFileArray('404.png', 'image/png', $tmpfile)], 'b' => ['image' => CreateFileArray('404.png', 'image/png', $tmpfile)]])];
     $args = ['name' => 'Test Product', 'images' => ['a' => [], 'b' => []]];
     $request = new ActionRequest($args, $files);
     $create = new CreateProduct($args, ['request' => $request]);
     $relation = clone $create->getRelation('images');
     unset($relation['foreign_schema']);
     $create->addRelation('images', $relation);
     $create->invoke();
 }