コード例 #1
0
 /**
  * @depends testSetEntity
  * @dataProvider expectRuntimeExceptionWithFormData
  */
 public function testMethodsThrowRuntimeExceptionWithForm($method, array $parameters = [], Collection $collection)
 {
     $this->collectionContainer->setEntity($collection);
     $formElementManager = $this->getMockBuilder(ServiceLocatorInterface::class)->getMock();
     $formElementManager->expects($this->any())->method('get')->with($this->formService)->willReturn('invalid form');
     $this->collectionContainer->setFormElementManager($formElementManager);
     $this->setExpectedException(\RuntimeException::class, '$form must be instance of');
     call_user_func_array([$this->collectionContainer, $method], $parameters);
 }