示例#1
0
 public function testMerge()
 {
     $message = new Message('foo');
     $message->setDesc('foo');
     $message->setMeaning('foo');
     $message->addSource($s1 = $this->getMock('JMS\\TranslationBundle\\Model\\SourceInterface'));
     $message2 = new Message('foo');
     $message2->setDesc('bar');
     $message2->addSource($s2 = $this->getMock('JMS\\TranslationBundle\\Model\\SourceInterface'));
     $message->merge($message2);
     $this->assertEquals('bar', $message->getDesc());
     $this->assertEquals('foo', $message->getMeaning());
     $this->assertSame(array($s1, $s2), $message->getSources());
 }