Skip to content

Commit

Permalink
Fix phpunit tests
Browse files Browse the repository at this point in the history
- $expected and $actual were flipped
  • Loading branch information
pixelpeter committed Feb 5, 2017
1 parent 56652e2 commit 2da208d
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions tests/WoocommerceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ public function setUp()
$this->woocommerce = new WoocommerceClient($this->client);
}

public function testSomethingIsTrue()
{
$this->assertTrue(true);
}

/**
* @test
*/
Expand All @@ -38,7 +33,7 @@ public function post_can_be_called()
->with('someurl',['bar' => 'baz'])
->andReturn('foo');

$this->assertEquals($this->woocommerce->post('someurl', ['bar' => 'baz']), 'foo');
$this->assertEquals('foo', $this->woocommerce->post('someurl', ['bar' => 'baz']));
}

/**
Expand All @@ -52,7 +47,7 @@ public function put_can_be_called()
->with('someurl',['bar' => 'baz'])
->andReturn('foo');

$this->assertEquals($this->woocommerce->put('someurl', ['bar' => 'baz']), 'foo');
$this->assertEquals('foo', $this->woocommerce->put('someurl', ['bar' => 'baz']));
}

/**
Expand All @@ -66,7 +61,7 @@ public function get_can_be_called()
->with('someurl',[])
->andReturn('foo');

$this->assertEquals($this->woocommerce->get('someurl'), 'foo');
$this->assertEquals('foo', $this->woocommerce->get('someurl'));
}

/**
Expand All @@ -80,7 +75,7 @@ public function delete_can_be_called()
->with('someurl',[])
->andReturn('foo');

$this->assertEquals($this->woocommerce->delete('someurl'), 'foo');
$this->assertEquals('foo', $this->woocommerce->delete('someurl'));
}

/**
Expand All @@ -94,7 +89,7 @@ public function getrequest_can_be_called()
->andReturn('foo');
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->getRequest(), 'foo');
$this->assertEquals('foo', $this->woocommerce->getRequest());
}

/**
Expand All @@ -108,15 +103,15 @@ public function getresponse_can_be_called()
->andReturn('foo');
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->getResponse(), 'foo');
$this->assertEquals('foo', $this->woocommerce->getResponse());
}

/**
* @test
*/
public function pagination_first_page_returns_valid_page_number()
{
$this->assertEquals($this->woocommerce->firstPage(), 1);
$this->assertEquals(1, $this->woocommerce->firstPage());
}

/**
Expand All @@ -132,7 +127,7 @@ public function pagination_last_page_returns_valid_page_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->lastPage(), 12);
$this->assertEquals(12, $this->woocommerce->lastPage());
}

/**
Expand All @@ -146,7 +141,7 @@ public function pagination_current_page_returns_first_page_when_empty()
->andReturn([]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->currentPage(), 1);
$this->assertEquals(1, $this->woocommerce->currentPage());
}

/**
Expand All @@ -161,7 +156,7 @@ public function pagination_current_page_returns_valid_page_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->currentPage(), 6);
$this->assertEquals(6, $this->woocommerce->currentPage());
}

/**
Expand All @@ -177,7 +172,7 @@ public function pagination_total_results_returns_valid_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->totalResults(), 1234);
$this->assertEquals(1234, $this->woocommerce->totalResults());
}

/**
Expand All @@ -193,7 +188,7 @@ public function pagination_total_pages_returns_valid_page_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->lastPage(), 13);
$this->assertEquals(13, $this->woocommerce->lastPage());
}

/**
Expand Down Expand Up @@ -225,7 +220,7 @@ public function pagination_previous_page_returns_valid_page_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->previousPage(), 4);
$this->assertEquals(4, $this->woocommerce->previousPage());
$this->assertTrue($this->woocommerce->hasPreviousPage());
$this->assertFalse($this->woocommerce->hasNotPreviousPage());
}
Expand Down Expand Up @@ -269,7 +264,7 @@ public function pagination_next_page_returns_valid_page_number()
]);
$this->client->http = $this->httpClient;

$this->assertEquals($this->woocommerce->nextPage(), 6);
$this->assertEquals(6, $this->woocommerce->nextPage());
$this->assertTrue($this->woocommerce->hasNextPage());
$this->assertFalse($this->woocommerce->hasNotNextPage());
}
Expand Down

0 comments on commit 2da208d

Please sign in to comment.