Changeset 2960

Show
Ignore:
Timestamp:
09/29/08 10:00:16 (7 weeks ago)
Author:
felix
Message:

- added a new test for the json response

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/felix-testing-implementation/samples/test/tests/fragment/SearchEngineSpamSuccessViewTest.php

    r2940 r2960  
    4444    $this->runView(); 
    4545    $this->assertResponseHasHTTPStatus(200); 
    46     $this->assertResponseHasContent(''); 
     46    $this->assertViewResultEquals(''); 
    4747    $this->assertHasLayer('content'); 
    4848    $this->assertHasLayer('decorator'); 
     49    $this->assertResponseHasNoRedirect(); 
     50    $this->assertContainerAttributeExists('title'); 
     51  } 
     52   
     53  public function testResponseJson() 
     54  {    
     55    $this->setArguments($this->createRequestDataHolder(array(AgaviWebRequestDataHolder::SOURCE_PARAMETERS => array('product_name' => 'spam')))); 
     56 
     57    $this->setAttribute('product_id', 1234); 
     58    $this->setAttribute('product_name', 'spam'); 
     59    $this->setAttribute('product_price', '123.45'); 
     60    $this->runView('json'); 
     61    $this->assertResponseHasHTTPStatus(200); 
     62    $this->assertViewResultEquals('{"product_price":"123.45"}'); 
     63    $this->assertResponseHasNoRedirect(); 
    4964  } 
    5065}