Example #1
0
 /**
  * getCurlOptions()
  */
 public function testOptionsGetter()
 {
     $request = new \sylouuu\Curl\Post($this->endpoint . 'user', ['data' => ['name' => 'foo', 'email' => '*****@*****.**']]);
     $options = $request->getCurlOptions();
     $this->assertEquals('foo', $options[10015]['name']);
     $this->assertEquals('*****@*****.**', $options[10015]['email']);
     $this->assertEquals('POST', $options[10036]);
     $request->send();
     $options = $request->getCurlOptions();
     $this->assertEquals('foo', $options[10015]['name']);
     $this->assertEquals('*****@*****.**', $options[10015]['email']);
     $this->assertEquals('POST', $options[10036]);
     $this->assertEquals(true, $options[19913]);
     $this->assertEquals(true, $options[2]);
 }
Example #2
0
 /**
  * Standard POST request with data
  */
 public function testPostRequest()
 {
     $request = new \sylouuu\Curl\Post($this->endpoint . 'user', ['data' => ['name' => 'foo', 'email' => '*****@*****.**']]);
     $request->send();
     $this->assertEquals(201, $request->getStatus());
 }