put() public method

Handle PUT requests
public put ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event
Beispiel #1
0
 /**
  * @covers Imbo\Resource\Metadata::put
  */
 public function testSupportsHttpPut()
 {
     $metadata = ['foo' => 'bar'];
     $this->request->expects($this->once())->method('getContent')->will($this->returnValue('{"foo":"bar"}'));
     $this->manager->expects($this->at(0))->method('trigger')->with('db.metadata.delete')->will($this->returnSelf());
     $this->manager->expects($this->at(1))->method('trigger')->with('db.metadata.update', ['metadata' => $metadata])->will($this->returnSelf());
     $this->response->expects($this->once())->method('setModel')->with($this->isInstanceOf('Imbo\\Model\\ArrayModel'));
     $this->resource->put($this->event);
 }