Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #70 from datasift/develop
Browse files Browse the repository at this point in the history
Release for 2.5.1
  • Loading branch information
Paul Mozo committed Dec 4, 2015
2 parents 4a48a9d + 49d7451 commit 11558b2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog
=========================
##v.2.5.1
###Fixed
* Fixed an issue with ```DataSift_Pylon::getStart```.

## v.2.5.0
### Added
* Support for the [/pylon/sample API endpoint](http://dev.datasift.com/pylon/docs/api/pylon-api-endpoints/pylonsample)
Expand Down
2 changes: 1 addition & 1 deletion lib/DataSift/Pylon.php
Expand Up @@ -352,7 +352,7 @@ public function getIdentityId()
*/
public function getStart()
{
return $this->start;
return $this->_start;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/DataSift/User.php
Expand Up @@ -27,7 +27,7 @@
*/
class DataSift_User
{
const USER_AGENT = 'DataSiftPHP/2.5.0';
const USER_AGENT = 'DataSiftPHP/2.5.1';

/**
* @var string The api url of the user.
Expand Down
51 changes: 51 additions & 0 deletions tests/PylonTest.php
Expand Up @@ -699,4 +699,55 @@ public function testNoHash(){

$pylon->sample($filter, $start, $end, $count);
}

/**
* DataProvider for testGetters
*
* @return array
*/
public function gettersProvider()
{
return array(
'Happy Path' => array(
'data' => array(
'identity_id' => 'def456def456def456def456def456de',
'start' => 123456789,
'name' => 'testName',
'status' => 'running',
'hash' => 'abc123abc123abc123abc123abc123ab',
'volume' => 123456,
'remaining_account_capacity' => 23456,
'remaining_index_capacity' => 34567,
'reached_capacity' => true
),
'expectedGetters' => array(
'getIdentityId' => 'def456def456def456def456def456de',
'getStart' => 123456789,
'getName' => 'testName',
'getStatus' => 'running',
'getHash' => 'abc123abc123abc123abc123abc123ab',
'getVolume' => 123456,
'getRemainingAccountCapacity' => 23456,
'getRemainingIndexCapacity' => 34567,
'hasReachedCapacity' => true
)
)
);
}

/**
* Tests the getters on the DataSift_Pylon class
*
* @dataProvider gettersProvider
*
* @param array $data
* @param array $expectedGetters
*/
public function testGetters(array $data, array $expectedGetters)
{
$pylon = new DataSift_Pylon($this->user, $data);
foreach ($expectedGetters as $getter => $expected) {
$this->assertEquals($expected, $pylon->{$getter}());
}
}
}

0 comments on commit 11558b2

Please sign in to comment.