Пример #1
0
 public function testGetHttpMethod()
 {
     $o = new PopulatedRequest();
     $o->setHttpMethod(HttpRequestTypes::HEAD);
     $this->assertEquals(HttpRequestTypes::HEAD, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::GET, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::POST, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::PUT, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::DELETE, $o->getHttpMethod());
     $o->setHttpMethod(HttpRequestTypes::GET);
     $this->assertNotEquals(HttpRequestTypes::HEAD, $o->getHttpMethod());
     $this->assertEquals(HttpRequestTypes::GET, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::POST, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::PUT, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::DELETE, $o->getHttpMethod());
     $o->setHttpMethod(HttpRequestTypes::POST);
     $this->assertNotEquals(HttpRequestTypes::HEAD, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::GET, $o->getHttpMethod());
     $this->assertEquals(HttpRequestTypes::POST, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::PUT, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::DELETE, $o->getHttpMethod());
     $o->setHttpMethod(HttpRequestTypes::PUT);
     $this->assertNotEquals(HttpRequestTypes::HEAD, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::GET, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::POST, $o->getHttpMethod());
     $this->assertEquals(HttpRequestTypes::PUT, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::DELETE, $o->getHttpMethod());
     $o->setHttpMethod(HttpRequestTypes::DELETE);
     $this->assertNotEquals(HttpRequestTypes::HEAD, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::GET, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::POST, $o->getHttpMethod());
     $this->assertNotEquals(HttpRequestTypes::PUT, $o->getHttpMethod());
     $this->assertEquals(HttpRequestTypes::DELETE, $o->getHttpMethod());
 }
Пример #2
0
 public function testIsDelete()
 {
     $o = new PopulatedRequest();
     $o->setHttpMethod(HttpRequestTypes::DELETE);
     $this->assertFalse($o->isHead());
     $this->assertFalse($o->isGet());
     $this->assertFalse($o->isPost());
     $this->assertFalse($o->isPut());
     $this->assertTrue($o->isDelete());
 }