Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Mar 31, 2017
1 parent 3264ae5 commit f451101
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/ForgeSdkTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php


use Laravel\Forge\Http;

class ForgeSdkTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
Expand All @@ -12,7 +10,7 @@ public function tearDown()

public function test_making_basic_requests()
{
$forge = new \Laravel\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));
$forge = new \Themsaid\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));

$http->shouldReceive('request')->once()->with('GET', 'recipes', [])->andReturn(
$response = Mockery::mock('GuzzleHttp\Psr7\Response')
Expand All @@ -26,7 +24,7 @@ public function test_making_basic_requests()

public function test_handling_validation_errors()
{
$forge = new \Laravel\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));
$forge = new \Themsaid\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));

$http->shouldReceive('request')->once()->with('GET', 'recipes', [])->andReturn(
$response = Mockery::mock('GuzzleHttp\Psr7\Response')
Expand All @@ -37,17 +35,17 @@ public function test_handling_validation_errors()

try {
$forge->recipes();
} catch (\Laravel\Forge\Exceptions\ValidationException $e) {
} catch (\Themsaid\Forge\Exceptions\ValidationException $e) {
}

$this->assertEquals(['name' => ['The name is required.']], $e->errors());
}

public function test_handling_404_errors()
{
$this->expectException(\Laravel\Forge\Exceptions\NotFoundException::class);
$this->expectException(\Themsaid\Forge\Exceptions\NotFoundException::class);

$forge = new \Laravel\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));
$forge = new \Themsaid\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));

$http->shouldReceive('request')->once()->with('GET', 'recipes', [])->andReturn(
$response = Mockery::mock('GuzzleHttp\Psr7\Response')
Expand All @@ -60,7 +58,7 @@ public function test_handling_404_errors()

public function test_handling_failed_action_errors()
{
$forge = new \Laravel\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));
$forge = new \Themsaid\Forge\Forge('123', $http = Mockery::mock('GuzzleHttp\Client'));

$http->shouldReceive('request')->once()->with('GET', 'recipes', [])->andReturn(
$response = Mockery::mock('GuzzleHttp\Psr7\Response')
Expand All @@ -71,7 +69,7 @@ public function test_handling_failed_action_errors()

try {
$forge->recipes();
} catch (\Laravel\Forge\Exceptions\FailedActionException $e) {
} catch (\Themsaid\Forge\Exceptions\FailedActionException $e) {
}

$this->assertEquals('Error!', $e->getMessage());
Expand Down

0 comments on commit f451101

Please sign in to comment.