public function testSettingsBag() { $apiKey = uniqid(); $this->entity->setApiKey($apiKey); $this->assertNotNull($this->entity->getApiKey()); $this->assertEquals(new ParameterBag(['apiKey' => $apiKey]), $this->entity->getSettingsBag()); // same any time $this->assertEquals(new ParameterBag(['apiKey' => $apiKey]), $this->entity->getSettingsBag()); }
/** * @return \PHPUnit_Framework_MockObject_MockObject */ protected function initTransport() { $apiKey = md5(rand()); $transportEntity = new MailChimpTransportEntity(); $transportEntity->setApiKey($apiKey); $client = $this->getMockBuilder('OroCRM\\Bundle\\MailChimpBundle\\Provider\\Transport\\MailChimpClient')->disableOriginalConstructor()->getMock(); $this->clientFactory->expects($this->once())->method('create')->with($apiKey)->will($this->returnValue($client)); $this->transport->init($transportEntity); return $client; }