Skip to content

Commit

Permalink
Merge e4e1c69 into 0e7f4fc
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Mar 23, 2020
2 parents 0e7f4fc + e4e1c69 commit bd3558a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
vendor/
composer.lock
tests/Unit/Data/*
!**/.gitkeep
!**/.gitkeep
*.cache
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
language: php
dist: trusty
php:
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- nightly
- 'hhvm'
matrix:
allow_failures:
- php: nightly
install:
- composer update
- composer install
script:
- ./vendor/bin/phpunit --coverage-clover ./tests/Logs/clover.xml
after_script:
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
}
],
"require": {
"php": "^7.0"
"php": ">=7.1",
"ext-zlib": "*"
},
"require-dev": {
"phpunit/phpunit": "^6.5",
"satooshi/php-coveralls": "^2.0"
"phpunit/phpunit": "^7.0 || ^8.0",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/JsonKeyValueStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private function load()
$this->content = json_decode(gzdecode($rawContent));

if ($this->content === null) {
throw new Exception('Invalid store content');
throw new \Exception('Invalid store content');
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BasicUsageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testCreateEmptyStore()
{
$store = $this->createNewStore();

$this->assertTrue(file_exists($store->getFile()));
$this->assertFileExists($store->getFile());
$this->assertEquals('{}', gzdecode(file_get_contents($store->getFile())));
}

Expand Down Expand Up @@ -85,7 +85,7 @@ public function testGetString()

$value = $store->get('testString');

$this->assertTrue(is_string($value));
$this->assertIsString($value);
$this->assertEquals('stringValue', $value);
}

Expand All @@ -95,7 +95,7 @@ public function testGetInteger()

$value = $store->get('testInteger');

$this->assertTrue(is_int($value));
$this->assertIsInt($value);
$this->assertEquals(12345, $value);
}

Expand All @@ -112,7 +112,7 @@ public function testGetObject()
$testObj->pet->type = 'cat';
$testObj->pet->name = 'Destructor';

$this->assertTrue(is_object($value));
$this->assertIsObject($value);
$this->assertEquals($testObj, $value);
}

Expand Down

0 comments on commit bd3558a

Please sign in to comment.