9 changed files with 80 additions and 46 deletions
@ -1,10 +1,16 @@
|
||||
language: php |
||||
sudo: false |
||||
|
||||
php: |
||||
- '5.4' |
||||
- '5.5' |
||||
- '5.6' |
||||
- 7.0 |
||||
- 5.6 |
||||
- 5.5 |
||||
- 5.4 |
||||
- 5.3 |
||||
- hhvm |
||||
|
||||
install: |
||||
- composer install |
||||
|
||||
before_script: |
||||
- composer install |
||||
|
||||
script: |
||||
- phpunit -c tests/phpunit.unit.xml |
||||
|
@ -0,0 +1,10 @@
|
||||
<phpunit stopOnError="true" stopOnFailure="true" colors="true"> |
||||
<testsuites> |
||||
<testsuite name="Miniflux Unit Tests"> |
||||
<directory>unit</directory> |
||||
</testsuite> |
||||
</testsuites> |
||||
<php> |
||||
<const name="DB_FILENAME" value=":memory:" /> |
||||
</php> |
||||
</phpunit> |
@ -0,0 +1,8 @@
|
||||
<?php |
||||
|
||||
require_once __DIR__.'/../../vendor/autoload.php'; |
||||
|
||||
abstract class BaseTest extends PHPUnit_Framework_TestCase |
||||
{ |
||||
|
||||
} |
@ -0,0 +1,13 @@
|
||||
<?php |
||||
|
||||
class HelperTest extends PHPUnit_Framework_TestCase |
||||
{ |
||||
public function testGetIpAddress() |
||||
{ |
||||
$_SERVER = array('HTTP_X_REAL_IP' => '127.0.0.1'); |
||||
$this->assertEquals('127.0.0.1', Helper\get_ip_address()); |
||||
|
||||
$_SERVER = array('HTTP_FORWARDED_FOR' => ' 127.0.0.1, 192.168.0.1'); |
||||
$this->assertEquals('127.0.0.1', Helper\get_ip_address()); |
||||
} |
||||
} |
Loading…
Reference in new issue