/** * @expectedException \InvalidArgumentException */ public function testSetParametersThrowsInvalidArgumentException() { $this->serializationHelper->expects($this->once())->method('serializeParameters')->willThrowException(new \Exception('asd')); $job = new Job(); $job->setType('JobType'); $job->setParameters(['foobar']); }