-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis and phpunit configuration, first test
- Loading branch information
Mario Blazek
committed
Jun 3, 2016
1 parent
04d5e7b
commit 3185922
Showing
4 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
language: php | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
|
||
matrix: | ||
# mark as finished before allow_failures are run | ||
fast_finish: true | ||
include: | ||
- php: 5.4 | ||
- php: 5.5 | ||
- php: 5.6 | ||
- php: 7.0 | ||
|
||
# test only master (+ pull requests) | ||
branches: | ||
only: | ||
- master | ||
|
||
# make sure to update composer to latest available version | ||
before_install: | ||
- composer self-update | ||
|
||
# install dependencies | ||
install: composer install --prefer-source | ||
|
||
# execute phpunit as the script command | ||
script: | ||
- ./vendor/bin/phpunit -d memory_limit=-1 --colors -c phpunit.xml | ||
|
||
# disable mail notifications | ||
notification: | ||
email: false | ||
|
||
# reduce depth (history) of git checkout | ||
git: | ||
depth: 30 | ||
|
||
# we don't need sudo | ||
sudo: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Netgen\Bundle\OpenWeatherMapBundle\Tests\Cache; | ||
|
||
use Netgen\Bundle\OpenWeatherMapBundle\Cache\HandlerInterface; | ||
use Netgen\Bundle\OpenWeatherMapBundle\Cache\Null; | ||
|
||
class NullTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testInstanceOfHandlerInterface() | ||
{ | ||
$this->assertInstanceOf(HandlerInterface::class, new Null()); | ||
} | ||
|
||
public function testHasMethodMustAlwaysReturnFalse() | ||
{ | ||
$nullHandler = new Null(); | ||
|
||
$this->assertFalse($nullHandler->has('some_key')); | ||
$this->assertFalse($nullHandler->has('test')); | ||
$this->assertFalse($nullHandler->has('weather')); | ||
} | ||
|
||
public function testGetMethodMustAlwaysReturnFalse() | ||
{ | ||
$nullHandler = new Null(); | ||
|
||
$this->assertFalse($nullHandler->get('some_key')); | ||
$this->assertFalse($nullHandler->get('test')); | ||
$this->assertFalse($nullHandler->get('weather')); | ||
} | ||
|
||
public function testSetMethodShouldDoNothing() | ||
{ | ||
$nullHandler = new Null(); | ||
|
||
$nullHandler->set('some_key', 'data', 120); | ||
$nullHandler->set('test', 'data', 1000); | ||
$nullHandler->set('weather', 'data', 3600); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Netgen\OpenWeatherMapBundle\Tests"> | ||
<directory>Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory>.</directory> | ||
<exclude> | ||
<directory>Tests</directory> | ||
<directory>vendor</directory> | ||
<file>NetgenOpenWeatherMapBundle.php</file> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |