source: sandbox/2.4.1-3/prototype/library/tonic/features/steps/response.php @ 6351

Revision 6351, 1.3 KB checked in by gustavo, 12 years ago (diff)

Ticket #2768 - Melhorias na inserção de destinatários na criacao de mensagem

  • Property svn:executable set to *
Line 
1<?php
2
3$steps->Given('/^an accept encoding of "([^"]*)"$/', function($world, $arg1) {
4    $world->config['acceptEncoding'] = $arg1;
5});
6
7$steps->When('/^I process content encoding$/', function($world) {
8    $world->response->doContentEncoding();
9});
10
11$steps->Then('/^the response header "([^"]*)" should contain \'([^\']*)\'$/', function($world, $arg1, $arg2) {
12    if ($world->response->headers[$arg1] != $arg2) throw new Exception;
13});
14
15$steps->Then('/^the response body should be ([^ ]*) and be "([^"]*)"$/', function($world, $arg1, $arg2) {
16    switch ($arg1) {
17    case 'gzipped':
18        var_dump($world->response->body, $arg2, gzencode($arg2));
19        if ($world->response->body != gzencode($arg2)) throw new Exception;
20        break;
21    case 'deflated':
22        if ($world->response->body != gzdeflate($arg2)) throw new Exception;
23        break;
24    case 'compressed':
25        if ($world->response->body != gzcompress($arg2)) throw new Exception;
26        break;
27    }
28});
29
30$steps->Then('/^I add a cache header of "([^"]*)"$/', function($world, $arg1) {
31    if ($arg1 == '') {
32        $world->response->addCacheHeader();
33    } else {
34        $world->response->addCacheHeader($arg1);
35    }
36});
37
38$steps->Then('/^I add an etag header of "([^"]*)"$/', function($world, $arg1) {
39    $world->response->addEtag($arg1);
40});
41
Note: See TracBrowser for help on using the repository browser.