public function hasSource() { $message = new Message('foo'); $s2 = $this->getMock('JMS\\TranslationBundle\\Model\\SourceInterface'); $s1 = $this->getMock('JMS\\TranslationBundle\\Model\\SourceInterface'); $s1->expects($this->once())->method('equals')->with($s2)->will($this->returnValue(true)); $message->addSource($s1); $this->assertTrue($message->hasSource($s2)); }