Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
public function testStatusUpdate()
{
$client = $this->getMockBuilder('Cake\\Network\\Http\\Client')
->setMethods([
'post'
])
->getMock();
$client
->expects($this->once())
->method('post')
->with()
->willReturn(new Response([
'HTTP/1.1 200 Ok'
], json_encode([
'id' => 1234,
'text' => 'Test123'
])));
$this->webservice->driver()->client($client);
$query = new Query($this->webservice, new Endpoint());
$query->create();
$query->set([
'text' => 'Test123'
]);
$resource = $this->webservice->execute($query);
$this->assertInstanceOf('Muffin\\Webservice\\Model\\Resource', $resource);
$this->assertEquals($resource->text, 'Test123');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.