-
-
Notifications
You must be signed in to change notification settings - Fork 190
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase code coverage #98
Conversation
…ion (excluded tests on __toString and Selectable interface)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvements!
Needs:
- whitespace cs fixes
- usage of
::class
where applicable - usage of short arrays
Thanks for working on this, @snsanich!
@@ -10,13 +11,20 @@ | |||
*/ | |||
class LazyArrayCollection extends AbstractLazyCollection | |||
{ | |||
private $_onInitialization; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docblock. Also, please don't prefix private/protected stuff with _
(we used to do it with PHP 4, when visibility wasn't supported yet)
// Intentionally empty. | ||
}; | ||
|
||
self::assertInstanceOf('Doctrine\Tests\DerivedArrayCollection', $collection->map($closure)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ::class
instead of string references
self::assertContainsOnlyInstancesOf('Doctrine\Tests\DerivedArrayCollection', $collection->partition($closure)); | ||
self::assertInstanceOf('Doctrine\Tests\DerivedArrayCollection', $collection->matching(new Criteria)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty newline required
/** | ||
* @author Alexander Golovnya <snsanich@gmail.com> | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this whitespace
{ | ||
$collection = new DerivedArrayCollection(new \stdClass); | ||
$closure = function () { | ||
// Intentionally empty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the why
this is intentionally empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this should never actually be called?
|
||
public function testLazyCollection() | ||
{ | ||
$collection = $this->_buildCollection(array('a', 'b', 'c')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you switch to short arrays when you move around these files?
Requests described in doctrine#98 whitespace cs fixes usage of ::class where applicable usage of short arrays Applied: php-cs-fixer --rules=@symfony fix tests/Doctrine/Tests
I made necessary changes. |
@snsanich looking good, waiting for travis :-) |
Requests described in doctrine#98 whitespace cs fixes usage of ::class where applicable usage of short arrays Applied: php-cs-fixer --rules=@symfony fix tests/Doctrine/Tests
Requests described in doctrine#98 whitespace cs fixes Applied: php-cs-fixer --rules=@symfony fix tests/Doctrine/Tests
Requests described in doctrine#98 usage of ::class where applicable usage of short arrays PHP 5.3, 5.4 is not supported anymore
Requests described in doctrine#98 usage of ::class where applicable usage of short arrays PHP 5.3, 5.4 is not supported anymore
Php 5.3, 5.4 doesn't support short array syntax and Class name resolution via ::class. I removed php 5.3, 5.4 from Travis.yml |
If we're not testing 5.3 and 5.4, then it should also be gone from |
We're not testing 5.3 and 5.4
@snsanich awesome, thanks! |
Hi.
I applied the same test suite on AbstractLazyCollection as for ArrayCollection (definitely, tests on __toString and Selectable interface was excluded for AbstractLazyCollection)