Created
February 11, 2016 12:54
-
-
Save Marlinc/02566ebafd6bcbc367ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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