Skip to content

Commit

Permalink
Merge pull request #98 from snsanich/coverage-up
Browse files Browse the repository at this point in the history
Increase code coverage
  • Loading branch information
Ocramius authored Dec 6, 2016
2 parents 2dfc898 + d774093 commit 0b0b541
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 529 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{"name": "Johannes Schmitt", "email": "[email protected]"}
],
"require": {
"php": "^5.3.2 || ^7.0"
"php": "^5.5 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Doctrine Collections Test Suite">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Tests\Common\Collections;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Tests\LazyArrayCollection;

/**
* Tests for {@see \Doctrine\Common\Collections\AbstractLazyCollection}.
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class AbstractLazyCollectionTest extends BaseArrayCollectionTest
{
protected function buildCollection(array $elements = [])
{
return new LazyArrayCollection(new ArrayCollection($elements));
}

public function testLazyCollection()
{
$collection = $this->buildCollection(['a', 'b', 'c']);

$this->assertFalse($collection->isInitialized());
$this->assertCount(3, $collection);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

namespace Doctrine\Tests\Common\Collections;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Tests\LazyArrayCollection;

class AbstractLazyCollectionTest extends \PHPUnit_Framework_TestCase
/**
* Tests for {@see \Doctrine\Common\Collections\AbstractLazyCollection}.
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class LazyCollectionTest extends BaseCollectionTest
{
public function testLazyCollection()
protected function setUp()
{
$collection = new LazyArrayCollection();

$this->assertFalse($collection->isInitialized());
$this->assertCount(3, $collection);

$collection->add('bar');
$this->assertTrue($collection->isInitialized());
$this->assertCount(4, $collection);
$this->collection = new LazyArrayCollection(new ArrayCollection());
}
}
Loading

0 comments on commit 0b0b541

Please sign in to comment.