Skip to content

Commit

Permalink
coverage updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Kozyrev committed Jul 29, 2014
1 parent 1c79443 commit fa08753
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ vendor/
build/
artifacts/
.idea
.DS_STORE
.DS_STORE
.coveralls.yml
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ php:
- hhvm

before_script:
- composer install
- composer self-update
- composer install --dev --no-interaction
- mkdir -p build/logs
- echo 'date.timezone = "America/Los_Angeles"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- export COVERALLS_RUN_LOCALLY=1
- export COVERALLS_REPO_TOKEN=kTvk73AvQhuHaFXMGLTtXyfNg8cUsyJNo

after_script:
- php vendor/bin/coveralls -v

matrix:
allow_failures:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ php-collection
==============

[![Build Status](https://travis-ci.org/urakozz/php-collection.svg?branch=master)](https://travis-ci.org/urakozz/php-collection)
[![Coverage Status](https://coveralls.io/repos/urakozz/php-collection/badge.png)](https://coveralls.io/r/urakozz/php-collection)
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
}
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.0",
"satooshi/php-coveralls": "dev-master"
},

"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
"minimum-stability": "stable"
}
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
19 changes: 19 additions & 0 deletions tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ public function testArrayAccessCountable()
$this->assertTrue($collection[1] === $data1);
$this->assertTrue(isset($collection[1]));

$collection[1] = $data;

$this->assertEquals(2, $collection->count());
$this->assertTrue($collection[1] === $data);
$this->assertTrue(isset($collection[1]));

}

public function testFrom()
{
$data = new Mock();
$array = [];
$array[] = $data;
$array[] = $data;

$collection = Collection::from(new \ArrayIterator($array));
$this->assertEquals(2, $collection->count());
$this->assertTrue($data === $collection[0]);
$this->assertTrue($data === $collection[1]);
}

public function testIterator()
Expand Down

0 comments on commit fa08753

Please sign in to comment.