public function testPostUrlCreated() { $curlRequestMock = $this->getMock('MadMimi\\CurlRequest'); $curlRequestMock->method('getInfo')->willReturn(200); $connectionMock = $this->getMockBuilder('MadMimi\\Connection')->setMethods(['debug'])->setConstructorArgs(['*****@*****.**', 'api-key-sir', $curlRequestMock])->getMock(); $connectionMock->expects($spy = $this->any())->method('debug'); $options = new Add(); $options->setName('the-list-name'); $connectionMock->request($options); $invocations = $spy->getInvocations(); $this->assertEquals('Url: https://api.madmimi.com/audience_lists', $invocations[2]->parameters[0]); }
public function testSetName() { $options = new Add(); $this->assertInstanceOf('MadMimi\\Options\\Lists\\Add', $options->setName('my list name')); $this->assertAttributeEquals('my list name', 'name', $options); }