source: sandbox/2.4.1-3/prototype/library/tonic/tests/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
3require_once('def/response.php');
4
5/**
6 * @namespace Tonic\Tests
7 */
8class ResponseTester extends UnitTestCase {
9   
10    function testDefaultCacheHeader() {
11       
12        $config = array(
13            'uri' => '/responsetest'
14        );
15       
16        $request = new Request($config);
17        $resource = $request->loadResource();
18        $response = $resource->exec($request);
19        $response->addCacheHeader();
20       
21        $this->assertEqual($response->headers['Cache-Control'], 'max-age=86400, must-revalidate');
22       
23    }
24   
25    function testNoCacheHeader() {
26       
27        $config = array(
28            'uri' => '/responsetest'
29        );
30       
31        $request = new Request($config);
32        $resource = $request->loadResource();
33        $response = $resource->exec($request);
34        $response->addCacheHeader(0);
35       
36        $this->assertEqual($response->headers['Cache-Control'], 'no-cache');
37       
38    }
39   
40    function testAddEtag() {
41       
42        $config = array(
43            'uri' => '/responsetest'
44        );
45       
46        $request = new Request($config);
47        $resource = $request->loadResource();
48        $response = $resource->exec($request);
49        $response->addEtag("123123");
50       
51        $this->assertEqual($response->headers['Etag'], '"123123"');
52       
53    }
54   
55}
56
Note: See TracBrowser for help on using the repository browser.