public function testModelName() { $model = new Post(); $model->setId(22); $metadata = $this->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata'); $metadata->expects($this->once())->method('getName')->will($this->returnValue('Acme\\Demo\\Entity\\Post')); $metadata->expects($this->once())->method('getIdentifierValues')->with($this->equalTo($model))->will($this->returnValue(array('id' => 22))); $result = $this->namingStrategy->modelName($model, $metadata); $this->assertEquals('post22', $result); }