diff --git a/README.md b/README.md
index defd1998..77d9ef0c 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ _**Please be aware that PHPCI is a beta-release project, so whilst it is very st
**Current Build Status**
-
+[](http://phpci.block8.net/build-status/view/2)
##What it does:
* Clones your project from Github, Bitbucket or a local path
diff --git a/Tests/PHPCI/Helper/CommandExecutorTest.php b/Tests/PHPCI/Helper/CommandExecutorTest.php
index 047f4258..4925e639 100644
--- a/Tests/PHPCI/Helper/CommandExecutorTest.php
+++ b/Tests/PHPCI/Helper/CommandExecutorTest.php
@@ -42,7 +42,7 @@ class CommandExecutorTest extends ProphecyTestCase
public function testExecuteCommand_ReturnsFalseForInvalidCommands()
{
- $returnValue = $this->testedExecutor->buildAndExecuteCommand(array('eerfdcvcho "%s"', 'Hello World'));
+ $returnValue = $this->testedExecutor->buildAndExecuteCommand(array('eerfdcvcho "%s" > /dev/null 2>&1', 'Hello World'));
$this->assertFalse($returnValue);
}
diff --git a/Tests/PHPCI/Plugin/PHPUnitTest.php b/Tests/PHPCI/Plugin/PHPUnitTest.php
deleted file mode 100644
index 89b24694..00000000
--- a/Tests/PHPCI/Plugin/PHPUnitTest.php
+++ /dev/null
@@ -1,172 +0,0 @@
-mockCiBuilder = $this->getMock(
- '\PHPCI\Builder',
- array('findBinary', 'executeCommand'),
- array(),
- "mockBuilder_phpUnit",
- false
- );
- $this->mockCiBuilder->buildPath = "/";
-
- $this->mockBuild = $this->getMock(
- '\PHPCI\Model\Build',
- array(),
- array(),
- "MockBuild",
- false
- );
-
- $this->loadPhpUnitWithOptions();
- }
-
- protected function loadPhpUnitWithOptions($arrOptions = array())
- {
- $this->testedPhpUnit = new PhpUnit($this->mockCiBuilder, $this->mockBuild, $arrOptions);
- }
-
- /**
- * @param \PHPUnit_Framework_MockObject_Matcher_Invocation $expectation
- */
- protected function expectFindBinaryToBeCalled($expectation)
- {
- $this->mockCiBuilder->expects($expectation)
- ->method("findBinary")
- ->will($this->returnValue("phpunit"));
- }
-
- /**
- * @param \PHPUnit_Framework_MockObject_Matcher_Invocation $expectation
- */
- public function expectExectuteCommandToBeCalled($expectation)
- {
- $this->mockCiBuilder->expects($expectation)
- ->method("executeCommand");
- }
-
- /**
- * @covers PHPUnit::execute
- */
- public function testExecute_ReturnsTrueWithoutArgs()
- {
- $returnValue = $this->testedPhpUnit->execute();
- $expectedReturn = true;
-
- $this->assertEquals($expectedReturn, $returnValue);
- }
-
- /**
- * @covers PHPUnit::execute
- * @covers PHPUnit::runDir
- */
- public function testExecute_CallsExecuteCommandOnceWhenGivenStringDirectory()
- {
- chdir('/');
-
- $this->loadPhpUnitWithOptions(
- array(
- 'directory' => "Fake/Test/Path"
- )
- );
-
- $this->expectFindBinaryToBeCalled($this->once());
- $this->expectExectuteCommandToBeCalled($this->once());
-
- $returnValue = $this->testedPhpUnit->execute();
- }
-
- /**
- * @covers PHPUnit::execute
- * @covers PHPUnit::runConfigFile
- */
- public function testExecute_CallsExecuteCommandOnceWhenGivenStringConfig()
- {
- chdir('/');
-
- $this->loadPhpUnitWithOptions(
- array(
- 'config' => "Fake/Test/config.xml"
- )
- );
-
- $this->expectFindBinaryToBeCalled($this->once());
- $this->expectExectuteCommandToBeCalled($this->once());
-
- $returnValue = $this->testedPhpUnit->execute();
- }
-
- /**
- * @covers PHPUnit::execute
- * @covers PHPUnit::runDir
- */
- public function testExecute_CallsExecuteCommandManyTimesWhenGivenArrayDirectory()
- {
- chdir('/');
-
- $this->loadPhpUnitWithOptions(
- array(
- 'directory' => array("dir1", "dir2")
- )
- );
-
- $this->expectFindBinaryToBeCalled($this->exactly(2));
- $this->expectExectuteCommandToBeCalled($this->exactly(2));
-
- $returnValue = $this->testedPhpUnit->execute();
- }
-
- /**
- * @covers PHPUnit::execute
- * @covers PHPUnit::runConfigFile
- */
- public function testExecute_CallsExecuteCommandManyTimesWhenGivenArrayConfig()
- {
- chdir('/');
-
- $this->loadPhpUnitWithOptions(
- array(
- 'config' => array("configfile1.xml", "configfile2.xml")
- )
- );
-
- $this->expectFindBinaryToBeCalled($this->exactly(2));
- $this->expectExectuteCommandToBeCalled($this->exactly(2));
-
- $returnValue = $this->testedPhpUnit->execute();
- }
-}
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 40aada7d..a6dec175 100644
--- a/composer.json
+++ b/composer.json
@@ -53,4 +53,4 @@
"jakub-onderka/php-parallel-lint": "Parallel Linting Tool",
"behat/behat": "Behat BDD Testing"
}
-}
+}
\ No newline at end of file
diff --git a/composer.lock b/composer.lock
index 62788338..1110c4b5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
- "hash": "0ac85acececb32f472d8aa807ed054e7",
+ "hash": "d6834b50e3ea80f4c6f0a05707d0e5f1",
"packages": [
{
"name": "block8/b8framework",
@@ -93,16 +93,16 @@
},
{
"name": "monolog/monolog",
- "version": "1.8.0",
+ "version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "392ef35fd470638e08d0160d6b1cbab63cb23174"
+ "reference": "65026b610f8c19e61d7242f600530677b0466aac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/392ef35fd470638e08d0160d6b1cbab63cb23174",
- "reference": "392ef35fd470638e08d0160d6b1cbab63cb23174",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/65026b610f8c19e61d7242f600530677b0466aac",
+ "reference": "65026b610f8c19e61d7242f600530677b0466aac",
"shasum": ""
},
"require": {
@@ -130,7 +130,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.8.x-dev"
+ "dev-master": "1.9.x-dev"
}
},
"autoload": {
@@ -157,7 +157,7 @@
"logging",
"psr-3"
],
- "time": "2014-03-23 19:50:26"
+ "time": "2014-04-24 13:29:03"
},
{
"name": "pimple/pimple",
@@ -298,17 +298,17 @@
},
{
"name": "symfony/console",
- "version": "v2.4.3",
+ "version": "v2.4.4",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "ef20f1f58d7f693ee888353962bd2db336e3bbcb"
+ "reference": "2e452005b1e1d003d23702d227e23614679eb5ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/ef20f1f58d7f693ee888353962bd2db336e3bbcb",
- "reference": "ef20f1f58d7f693ee888353962bd2db336e3bbcb",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/2e452005b1e1d003d23702d227e23614679eb5ca",
+ "reference": "2e452005b1e1d003d23702d227e23614679eb5ca",
"shasum": ""
},
"require": {
@@ -349,21 +349,21 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
- "time": "2014-03-01 17:35:04"
+ "time": "2014-04-27 13:34:57"
},
{
"name": "symfony/yaml",
- "version": "v2.4.3",
+ "version": "v2.4.4",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd"
+ "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd",
- "reference": "77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
+ "reference": "65539ecde838f9c0d18b006b2101e3deb4b5c9ff",
"shasum": ""
},
"require": {
@@ -398,10 +398,482 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2014-03-12 18:29:58"
+ "time": "2014-04-18 20:37:09"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "phpspec/prophecy",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy.git",
+ "reference": "976a65af02a2a0e17ce6c949f7b43437205628bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/976a65af02a2a0e17ce6c949f7b43437205628bb",
+ "reference": "976a65af02a2a0e17ce6c949f7b43437205628bb",
+ "shasum": ""
+ },
+ "require-dev": {
+ "phpspec/phpspec": "2.0.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "homepage": "http://phpspec.org",
+ "keywords": [
+ "Double",
+ "Dummy",
+ "fake",
+ "mock",
+ "spy",
+ "stub"
+ ],
+ "time": "2014-01-24 11:03:43"
+ },
+ {
+ "name": "phpspec/prophecy-phpunit",
+ "version": "v1.0.1",
+ "target-dir": "Prophecy/PhpUnit",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy-phpunit.git",
+ "reference": "640c8c3bc9e02d7878e5ed22b1f79818d6bb6caf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/640c8c3bc9e02d7878e5ed22b1f79818d6bb6caf",
+ "reference": "640c8c3bc9e02d7878e5ed22b1f79818d6bb6caf",
+ "shasum": ""
+ },
+ "require": {
+ "phpspec/prophecy": "~1.0"
+ },
+ "suggest": {
+ "phpunit/phpunit": "if it is not installed globally"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\PhpUnit\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christophe Coevoet",
+ "email": "stof@notk.org"
+ }
+ ],
+ "description": "PhpUnit test case integrating the Prophecy mocking library",
+ "homepage": "http://phpspec.org",
+ "keywords": [
+ "phpunit",
+ "prophecy"
+ ],
+ "time": "2014-03-03 23:03:12"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "1.2.17",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
+ "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-file-iterator": ">=1.3.0@stable",
+ "phpunit/php-text-template": ">=1.2.0@stable",
+ "phpunit/php-token-stream": ">=1.1.3@stable"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*@dev"
+ },
+ "suggest": {
+ "ext-dom": "*",
+ "ext-xdebug": ">=2.0.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2014-03-28 10:53:45"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.3.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "File/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2013-10-10 15:34:57"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+ "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "Text/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2014-01-30 17:20:04"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2013-08-02 07:42:54"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "1.2.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32",
+ "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2014-03-03 05:10:30"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "3.7.37",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
+ "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=5.3.3",
+ "phpunit/php-code-coverage": "~1.2",
+ "phpunit/php-file-iterator": "~1.3",
+ "phpunit/php-text-template": "~1.1",
+ "phpunit/php-timer": "~1.0",
+ "phpunit/phpunit-mock-objects": "~1.2",
+ "symfony/yaml": "~2.0"
+ },
+ "require-dev": {
+ "pear-pear.php.net/pear": "1.9.4"
+ },
+ "suggest": {
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "composer/bin/phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.7.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHPUnit/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "",
+ "../../symfony/yaml/"
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2014-04-30 12:24:19"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875",
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-text-template": ">=1.1.1@stable"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHPUnit/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2013-01-13 10:24:48"
}
],
- "packages-dev": null,
"aliases": [
],
diff --git a/phpci.yml b/phpci.yml
index 52330436..9dda1fa4 100644
--- a/phpci.yml
+++ b/phpci.yml
@@ -6,12 +6,17 @@ build_settings:
- "PHPCI/Command" # PHPMD complains about un-used parameters, but they are required.
- "public/install.php" # PHPCS really doesn't like PHP mixed with HTML (and so it shouldn't)
+setup:
+ composer:
+ action: "install"
+
test:
php_mess_detector:
- allowed_warnings: 35 # Set max warnings at the current level - Disallow any further errors creeping in.
+ allowed_warnings: 10 # Set max warnings at the current level - Disallow any further errors creeping in.
php_code_sniffer:
standard: "PSR2"
php_loc:
+ php_unit:
failure:
email:
diff --git a/public/assets/js/build-plugins/phpunit.js b/public/assets/js/build-plugins/phpunit.js
new file mode 100644
index 00000000..c09855a9
--- /dev/null
+++ b/public/assets/js/build-plugins/phpunit.js
@@ -0,0 +1,65 @@
+var phpunitPlugin = PHPCI.UiPlugin.extend({
+ id: 'build-phpunit-errors',
+ css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12',
+ title: 'PHPUnit',
+ lastData: null,
+ displayOnUpdate: false,
+ box: true,
+
+ register: function() {
+ var self = this;
+ var query = PHPCI.registerQuery('phpunit-data', -1, {key: 'phpunit-data'})
+
+ $(window).on('phpunit-data', function(data) {
+ self.onUpdate(data);
+ });
+
+ $(window).on('build-updated', function(data) {
+ if (data.queryData.status > 1) {
+ self.displayOnUpdate = true;
+ query();
+ }
+ });
+ },
+
+ render: function() {
+
+ return $('
' +
+ '' +
+ '' +
+ ' | Test | ' +
+ '
' +
+ '
');
+ },
+
+ onUpdate: function(e) {
+ if (this.lastData && this.lastData[0]) {
+ return;
+ }
+
+ this.lastData = e.queryData;
+
+ var tests = this.lastData[0].meta_value;
+ var tbody = $('#phpunit-data tbody');
+ tbody.empty();
+
+ for (var i in tests) {
+
+ var row = $('
' +
+ ''+tests[i].suite+'' +
+ '::'+tests[i].test+' ' +
+ ''+(tests[i].message || '')+' | ' +
+ '
');
+
+ if (!tests[i].pass) {
+ row.addClass('danger');
+ } else {
+ row.addClass('success');
+ }
+
+ tbody.append(row);
+ }
+ }
+});
+
+PHPCI.registerPlugin(new phpunitPlugin());
diff --git a/public/assets/js/build-plugins/warnings.js b/public/assets/js/build-plugins/warnings.js
index 8b86a1e7..cc2db78f 100644
--- a/public/assets/js/build-plugins/warnings.js
+++ b/public/assets/js/build-plugins/warnings.js
@@ -3,10 +3,11 @@ var warningsPlugin = PHPCI.UiPlugin.extend({
css: 'col-lg-6 col-md-6 col-sm-12 col-xs-12',
title: 'Quality Trend',
keys: {
- 'phpmd-warnings': 'PHPMD Warnings',
- 'phpcs-warnings': 'PHPCS Warnings',
- 'phpcs-errors': 'PHPCS Errors',
- 'phplint-errors': 'PHPLint Errors'
+ 'phpmd-warnings': 'PHPMD Warnings',
+ 'phpcs-warnings': 'PHPCS Warnings',
+ 'phpcs-errors': 'PHPCS Errors',
+ 'phplint-errors': 'PHPLint Errors',
+ 'phpunit-errors': 'PHPUnit Errors'
},
data: {},
displayOnUpdate: false,
@@ -19,7 +20,7 @@ var warningsPlugin = PHPCI.UiPlugin.extend({
queries.push(PHPCI.registerQuery(key, -1, {num_builds: 10, key: key}));
}
- $(window).on('phpmd-warnings phpcs-warnings phpcs-errors phplint-errors', function(data) {
+ $(window).on('phpmd-warnings phpcs-warnings phpcs-errors phplint-errors phpunit-errors', function(data) {
self.onUpdate(data);
});
diff --git a/public/index.php b/public/index.php
index e1754b62..134e9a7b 100644
--- a/public/index.php
+++ b/public/index.php
@@ -16,4 +16,3 @@ require_once('../bootstrap.php');
$fc = new PHPCI\Application($config, new b8\Http\Request());
print $fc->handleRequest();
-
diff --git a/vars.php b/vars.php
index 46b88c79..2408d41d 100644
--- a/vars.php
+++ b/vars.php
@@ -26,7 +26,6 @@ if (!defined('PHPCI_IS_CONSOLE')) {
define('PHPCI_IS_CONSOLE', false);
}
-$isWin = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
if (!defined('IS_WIN')) {
- define('IS_WIN', $isWin);
+ define('IS_WIN', ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false));
}