18 'operations' => array(
20 'httpMethod' =>
'PUT',
21 'parameters' => array(
22 'ContentMD5' => array(),
32 $client->setDescription($description);
45 $command = $client->getCommand(
'test', array(
49 $event =
new Event(array(
'command' => $command));
50 $request = $command->prepare();
52 $plugin->onCommandBeforeSend($event);
53 $this->assertEquals(
'E1bGfXrRY42Ba/uCLdLCXQ==', (
string) $request->getHeader(
'Content-MD5'));
59 $client->getDescription()->getOperation(
'test')->setHttpMethod(
'GET');
60 $command = $client->getCommand(
'test');
61 $event =
new Event(array(
'command' => $command));
62 $request = $command->prepare();
64 $plugin->onCommandBeforeSend($event);
65 $this->assertNull($request->getHeader(
'Content-MD5'));
71 $client->getDescription()->getOperation(
'test')->setHttpMethod(
'GET');
72 $command = $client->getCommand(
'test', array(
75 $event =
new Event(array(
'command' => $command));
76 $request = $command->prepare();
78 $plugin->onCommandBeforeSend($event);
79 $listeners = $request->getEventDispatcher()->getListeners(
'request.complete');
80 $this->assertNotEmpty($listeners);
86 $client->getDescription()->getOperation(
'test')->setHttpMethod(
'GET');
87 $command = $client->getCommand(
'test', array(
88 'ValidateMD5' =>
false
90 $event =
new Event(array(
'command' => $command));
91 $request = $command->prepare();
93 $plugin->onCommandBeforeSend($event);
94 $listeners = $request->getEventDispatcher()->getListeners(
'request.complete');
95 $this->assertEmpty($listeners);