Skip to content

Commit

Permalink
Update RequestTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco authored Oct 2, 2024
1 parent 8689031 commit f2ee041
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,42 @@ public function testCanGet(): void
public function testCanPost(): void
{
$request = new Request();
$response = $request->post('https://httpbin.org/post', ['name' => 'GuiBranco']);
$response = $request->post('https://httpbin.org/post');
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPost() Warning test

Expected //end testCanPost()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

public function testCanPostWithPayload(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanPostWithPayload() Warning test

Missing doc comment for function testCanPostWithPayload()
{
$request = new Request();
$response = $request->post('https://httpbin.org/post', array(), ['name' => 'GuiBranco']);

Check warning

Code scanning / Phpcs (reported by Codacy)

Short array syntax must be used to define arrays Warning test

Short array syntax must be used to define arrays
$this->assertEquals(200, $response->statusCode);
}

public function testCanPut(): void
{
$request = new Request();
$response = $request->put('https://httpbin.org/put', ['name' => 'GuiBranco']);
$response = $request->put('https://httpbin.org/put');
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPut() Warning test

Expected //end testCanPut()

public function testCanPutWithPayload(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanPutWithPayload() Warning test

Missing doc comment for function testCanPutWithPayload()
{
$request = new Request();
$response = $request->put('https://httpbin.org/put', array(), ['name' => 'GuiBranco']);

Check warning

Code scanning / Phpcs (reported by Codacy)

Short array syntax must be used to define arrays Warning test

Short array syntax must be used to define arrays
$this->assertEquals(200, $response->statusCode);
}

public function testCanPatch(): void
{
$request = new Request();
$response = $request->patch('https://httpbin.org/patch', ['name' => 'GuiBranco']);
$response = $request->patch('https://httpbin.org/patch');
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPatch() Warning test

Expected //end testCanPatch()

public function testCanPatchWithPayload(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanPatchWithPayload() Warning test

Missing doc comment for function testCanPatchWithPayload()
{
$request = new Request();
$response = $request->patch('https://httpbin.org/patch', array(), ['name' => 'GuiBranco']);

Check warning

Code scanning / Phpcs (reported by Codacy)

Short array syntax must be used to define arrays Warning test

Short array syntax must be used to define arrays
$this->assertEquals(200, $response->statusCode);
}

Expand Down Expand Up @@ -75,7 +96,28 @@ public function testCanGetWithHeaders(): void
public function testCanPostWithHeaders(): void
{
$request = new Request();
$response = $request->post('https://httpbin.org/post', json_encode(['name' => 'GuiBranco']), ['X-Test: test']);
$response = $request->post('https://httpbin.org/post', ['X-Test: test'], json_encode(['name' => 'GuiBranco']));
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPostWithHeaders() Warning test

Expected //end testCanPostWithHeaders()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

public function testCanPutWithHeaders(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanPutWithHeaders() Warning test

Missing doc comment for function testCanPutWithHeaders()
{
$request = new Request();
$response = $request->put('https://httpbin.org/put', ['X-Test: test'], json_encode(['name' => 'GuiBranco']));
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPutWithHeaders() Warning test

Expected //end testCanPutWithHeaders()

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

public function testCanPatchWithHeaders(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanPatchWithHeaders() Warning test

Missing doc comment for function testCanPatchWithHeaders()
{
$request = new Request();
$response = $request->patch('https://httpbin.org/patch', ['X-Test: test'], json_encode(['name' => 'GuiBranco']));
$this->assertEquals(200, $response->statusCode);
}

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 2 blank lines after function; 1 found Warning test

Expected 2 blank lines after function; 1 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected 1 blank line before closing function brace; 0 found Warning test

Expected 1 blank line before closing function brace; 0 found

Check warning

Code scanning / Phpcs (reported by Codacy)

Expected //end testCanPatchWithHeaders() Warning test

Expected //end testCanPatchWithHeaders()

public function testCanDeleteWithHeaders(): void

Check warning

Code scanning / Phpcs (reported by Codacy)

Missing doc comment for function testCanDeleteWithHeaders() Warning test

Missing doc comment for function testCanDeleteWithHeaders()
{
$request = new Request();
$response = $request->delete('https://httpbin.org/delete', ['X-Test: test'], json_encode(['name' => 'GuiBranco']));
$this->assertEquals(200, $response->statusCode);
}

Expand Down

0 comments on commit f2ee041

Please sign in to comment.