/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Expected string, but got integer for argument 1 */ public function testSetCustomClassNameMustBeAString() { $compiler = new ClassCompiler('Concise\\Mock\\ClassCompilerMock1'); $compiler->setCustomClassName(123); }
/** * Compiler the mock into a usable instance. * * @return object */ public function get() { $compiler = new ClassCompiler($this->className, $this->niceMock, $this->constructorArgs, $this->disableConstructor, $this->disableClone); if ($this->customClassName) { $compiler->setCustomClassName($this->customClassName); } $compiler->setRules($this->rules); foreach ($this->expose as $method) { $compiler->addExpose($method); } $mockInstance = $compiler->newInstance(); $this->testCase->addMockInstance($this, $mockInstance); $this->restoreState($mockInstance); foreach ($this->properties as $name => $value) { $this->testCase->setProperty($mockInstance, $name, $value); } return $mockInstance; }