Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Clean up Item test #218

Merged
merged 4 commits into from
Aug 31, 2015
Merged

Conversation

localheinz
Copy link
Contributor

This PR

  • gives code a bit of room to breathe
  • renames variables
  • asserts sameness, not just equality
  • properly asserts fluent interface

馃拋 Vertical whitespace helps - also, we're testing the behaviour of League\Fractal\Resource\Item here, right?

@@ -29,8 +31,9 @@ public function testGetTransformer()
*/
public function testSetResourceKey()
{
$collection = Mockery::mock('League\Fractal\Resource\Item')->makePartial();
$this->assertInstanceOf('League\Fractal\Resource\Item', $collection->setResourceKey('foo'));
$item = Mockery::mock('League\Fractal\Resource\Item')->makePartial();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I get this, wouldn't a simple

$item = new Item();

suffice?

$collection = Mockery::mock('League\Fractal\Resource\Item')->makePartial();
$collection->setResourceKey('foo');
$this->assertEquals('foo', $collection->getResourceKey());
$item = Mockery::mock('League\Fractal\Resource\Item')->makePartial();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

willishq added a commit that referenced this pull request Aug 31, 2015
@willishq willishq merged commit 62a14e4 into thephpleague:master Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants