Skip to content

Commit

Permalink
Merge pull request #49 from abacaphiliac/integration-tests
Browse files Browse the repository at this point in the history
add ZF2 and ZF3 integration tests
  • Loading branch information
abacaphiliac authored Oct 15, 2017
2 parents b8435ef + d947deb commit a00897d
Show file tree
Hide file tree
Showing 14 changed files with 10,283 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.idea
composer.lock
/composer.lock
coverage.xml
humbug.json
humbuglog.txt
/vendor
vendor
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,29 @@ jobs:
script:
- composer install --no-interaction --prefer-source
- composer lint:style
- stage: coverage
- stage: big-test
php: 7.1
script:
- composer install --no-interaction --prefer-source
- composer test:coverage
- stage: mutations
- stage: big-test
php: 7.1
script:
- composer install --no-interaction --prefer-source
- composer require --dev humbug/humbug:^1.0@dev
- composer test:mutations
- stage: big-test
php: 5.6
script:
- cd test/ZF2
- composer install --no-interaction --prefer-source
- vendor/bin/phpunit
- stage: big-test
php: 5.6
script:
- cd test/ZF3
- composer install --no-interaction --prefer-source
- vendor/bin/phpunit

notifications:
email: false
2 changes: 1 addition & 1 deletion Module.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

include __DIR__ . "/src/EnliteMonolog/Module.php";
include __DIR__ . "/src/EnliteMonolog/Module.php";
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
}
},
"scripts": {
"lint:beautify": "vendor/bin/phpcbf --standard=PSR2 --extensions=php --severity=1 config/ src/ test/ -v",
"lint:style": "vendor/bin/phpcs --standard=PSR2 --extensions=php --severity=1 config/ src/ test/ -v",
"lint:syntax": "vendor/bin/parallel-lint config/ src/ test/",
"lint:beautify": "vendor/bin/phpcbf --standard=PSR2 --extensions=php -v --ignore=*/vendor/* .",
"lint:style": "vendor/bin/phpcs --standard=PSR2 --extensions=php -v --ignore=*/vendor/* .",
"lint:syntax": "vendor/bin/parallel-lint --exclude vendor --exclude test/ZF2/vendor --exclude test/ZF3/vendor .",
"lint:syntax-php53": "vendor/bin/parallel-lint --exclude src/EnliteMonolog/Service/MonologServiceAwareTrait.php config/ src/ test/",
"test:coverage": "vendor/bin/phpunit --coverage-text",
"test:mutations": "vendor/bin/humbug && cat humbuglog.txt",
Expand Down
37 changes: 37 additions & 0 deletions test/ZF2/IntegrationTest/IntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace EnliteMonologTest\ZF2\IntegrationTest;

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Zend\Mvc\Application;

class IntegrationTest extends TestCase
{
/** @var Application */
private $sut;

protected function setUp()
{
$this->sut = Application::init(array(
'module_listener_options' => array(
'config_glob_paths' => array(
__DIR__ . '/config/{{,*.}global,{,*.}local}.php',
),
),
'modules' => array(
'EnliteMonolog',
),
));
}

public function testEnliteMonologServiceAvailableViaApplicationContainer()
{
$services = $this->sut->getServiceManager();

/** @var Logger $logger */
$logger = $services->get('EnliteMonologService');

self::assertInstanceOf('\Monolog\Logger', $logger);
}
}
1 change: 1 addition & 0 deletions test/ZF2/IntegrationTest/config/monolog.global.php
16 changes: 16 additions & 0 deletions test/ZF2/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "enlitepro/enlite-monolog-zf2-integration-test",
"description": "Tests enlitepro/enlite-monolog ZF2 integration.",
"minimum-stability": "stable",
"license": "MIT",
"autoload": {
"psr-4": {
"EnliteMonolog\\": "../../src/EnliteMonolog"
}
},
"require-dev": {
"monolog/monolog": "^1.0.2",
"zendframework/zendframework": "^2.0",
"phpunit/phpunit": "^5.0"
}
}
Loading

0 comments on commit a00897d

Please sign in to comment.