public function testUpdate()
 {
     $this->mockRequest('PUT', MockResource::url() . '/1', array("param1" => "value1", "param2" => "value2"));
     MockResource::update('1', array("param1" => "value1", "param2" => "value2"));
 }
Esempio n. 2
0
 /**
  * testUpdate method
  *
  * @return void
  */
 public function testUpdate()
 {
     $client = $this->getMockBuilder('Att\\M2X\\M2X')->setConstructorArgs(array('foobar'))->setMethods(array('put'))->getMock();
     $expectedPost = array('name' => 'Original Name', 'description' => 'Updated Description', 'foo' => 'abc123', 'bar' => 10005);
     $client->expects($this->once())->method('put')->with($this->equalTo('/foo/112233'), $this->equalTo($expectedPost));
     $data = array('id' => '112233', 'name' => 'Original Name', 'description' => 'Original Description', 'foo' => 'abc123', 'bar' => 10005, 'readonly' => 'Original Readonly');
     $resource = new MockResource($client, $data);
     $update = array('description' => 'Updated Description', 'readonly' => 'Updated Readonly');
     $resource->update($update);
 }