public function testGetTeam2Name() { $team = $this->getMock('Application\\Model\\Entity\\Team', array('getName')); $team->expects($this->once())->method('getName')->will($this->returnValue('Foo')); $this->plannedMatch->setTeam2($team); $this->assertEquals("Foo", $this->plannedMatch->getTeam2Name()); }