@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Service; |
| 11 | 11 | |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Service; |
| 11 | 11 | |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | * @see ProjectService::createProject() |
| 116 | 116 | * @param Project $project |
| 117 | 117 | */ |
| 118 | - protected function processAccessInformation(Project &$project) |
|
| 118 | + protected function processAccessInformation(Project&$project) |
|
| 119 | 119 | { |
| 120 | 120 | $matches = array(); |
| 121 | 121 | $reference = $project->getReference(); |
@@ -2,23 +2,23 @@ |
||
| 2 | 2 | |
| 3 | 3 | // Define our APPLICATION_PATH, if not already defined: |
| 4 | 4 | if (!defined('APPLICATION_PATH')) { |
| 5 | - define('APPLICATION_PATH', dirname(__FILE__) . '/'); |
|
| 5 | + define('APPLICATION_PATH', dirname(__FILE__).'/'); |
|
| 6 | 6 | define('PHPCI_DIR', APPLICATION_PATH); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // Define our PHPCI_URL, if not already defined: |
| 10 | 10 | if (!defined('PHPCI_URL') && isset($config)) { |
| 11 | - define('PHPCI_URL', $config->get('phpci.url', '') . '/'); |
|
| 11 | + define('PHPCI_URL', $config->get('phpci.url', '').'/'); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // Define PHPCI_BIN_DIR |
| 15 | 15 | if (!defined('PHPCI_BIN_DIR')) { |
| 16 | - define('PHPCI_BIN_DIR', PHPCI_DIR . 'vendor/bin/'); |
|
| 16 | + define('PHPCI_BIN_DIR', PHPCI_DIR.'vendor/bin/'); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // Define PHPCI_BUILD_ROOT_DIR |
| 20 | 20 | if (!defined('PHPCI_BUILD_ROOT_DIR')) { |
| 21 | - define('PHPCI_BUILD_ROOT_DIR', PHPCI_DIR . 'PHPCI/build/'); |
|
| 21 | + define('PHPCI_BUILD_ROOT_DIR', PHPCI_DIR.'PHPCI/build/'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | // Should PHPCI run the Shell plugin? |
@@ -11,11 +11,11 @@ discard block |
||
| 11 | 11 | date_default_timezone_set(@date_default_timezone_get()); |
| 12 | 12 | |
| 13 | 13 | // Load Composer autoloader: |
| 14 | -require_once(dirname(__DIR__) . '/vendor/autoload.php'); |
|
| 14 | +require_once(dirname(__DIR__).'/vendor/autoload.php'); |
|
| 15 | 15 | |
| 16 | 16 | // If the PHPCI config file is not where we expect it, try looking in |
| 17 | 17 | // env for an alternative config path. |
| 18 | -$configFile = dirname(__FILE__) . '/../PHPCI/config.yml'; |
|
| 18 | +$configFile = dirname(__FILE__).'/../PHPCI/config.yml'; |
|
| 19 | 19 | |
| 20 | 20 | if (!file_exists($configFile)) { |
| 21 | 21 | $configEnv = getenv('phpci_config_file'); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $conf = array(); |
| 30 | 30 | $conf['b8']['app']['namespace'] = 'PHPCI'; |
| 31 | 31 | $conf['b8']['app']['default_controller'] = 'Home'; |
| 32 | -$conf['b8']['view']['path'] = dirname(__DIR__) . '/PHPCI/View/'; |
|
| 32 | +$conf['b8']['view']['path'] = dirname(__DIR__).'/PHPCI/View/'; |
|
| 33 | 33 | |
| 34 | 34 | $config = new b8\Config($conf); |
| 35 | 35 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $config->loadYaml($configFile); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -require_once(dirname(__DIR__) . '/vars.php'); |
|
| 40 | +require_once(dirname(__DIR__).'/vars.php'); |
|
| 41 | 41 | |
| 42 | 42 | \PHPCI\Helper\Lang::init($config); |
| 43 | 43 | \PHPCI\Helper\Lang::setLanguage("en"); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class MailerFactoryTest extends \PHPUnit_Framework_TestCase |
| 20 | 20 | { |
| 21 | - public function setUp() |
|
| 21 | + public function setUp() |
|
| 22 | 22 | { |
| 23 | 23 | } |
| 24 | 24 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | parent::setUp(); |
| 29 | 29 | $mockBuildLogger = $this->prophesize('PHPCI\Logging\BuildLogger'); |
| 30 | 30 | $class = IS_WIN ? 'PHPCI\Helper\WindowsCommandExecutor' : 'PHPCI\Helper\UnixCommandExecutor'; |
| 31 | - $this->testedExecutor = new $class($mockBuildLogger->reveal(), __DIR__ . "/"); |
|
| 31 | + $this->testedExecutor = new $class($mockBuildLogger->reveal(), __DIR__."/"); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function testGetLastOutput_ReturnsOutputOfCommand() |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $thisFileName = "CommandExecutorTest.php"; |
| 64 | 64 | $returnValue = $this->testedExecutor->findBinary($thisFileName); |
| 65 | - $this->assertEquals(__DIR__ . "/" . $thisFileName, $returnValue); |
|
| 65 | + $this->assertEquals(__DIR__."/".$thisFileName, $returnValue); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $contextIn = array(); |
| 45 | 45 | |
| 46 | 46 | $this->mockLogger->log($level, $message, Argument::type('array')) |
| 47 | - ->shouldBeCalledTimes(1); |
|
| 47 | + ->shouldBeCalledTimes(1); |
|
| 48 | 48 | |
| 49 | 49 | $this->testedBuildLogger->log($message, $level, $contextIn); |
| 50 | 50 | } |
@@ -56,13 +56,13 @@ discard block |
||
| 56 | 56 | $contextIn = array(); |
| 57 | 57 | |
| 58 | 58 | $this->mockLogger->log($level, "One", Argument::type('array')) |
| 59 | - ->shouldBeCalledTimes(1); |
|
| 59 | + ->shouldBeCalledTimes(1); |
|
| 60 | 60 | |
| 61 | 61 | $this->mockLogger->log($level, "Two", Argument::type('array')) |
| 62 | - ->shouldBeCalledTimes(1); |
|
| 62 | + ->shouldBeCalledTimes(1); |
|
| 63 | 63 | |
| 64 | 64 | $this->mockLogger->log($level, "Three", Argument::type('array')) |
| 65 | - ->shouldBeCalledTimes(1); |
|
| 65 | + ->shouldBeCalledTimes(1); |
|
| 66 | 66 | |
| 67 | 67 | $this->testedBuildLogger->log($message, $level, $contextIn); |
| 68 | 68 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ); |
| 79 | 79 | |
| 80 | 80 | $this->mockLogger->log($level, $message, $expectedContext) |
| 81 | - ->shouldBeCalledTimes(1); |
|
| 81 | + ->shouldBeCalledTimes(1); |
|
| 82 | 82 | |
| 83 | 83 | $this->testedBuildLogger->log($message, $level, $contextIn); |
| 84 | 84 | } |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | $expectedLevel = LogLevel::ERROR; |
| 90 | 90 | |
| 91 | 91 | $this->mockLogger->log($expectedLevel, |
| 92 | - Argument::type('string'), |
|
| 93 | - Argument::type('array')) |
|
| 94 | - ->shouldBeCalledTimes(1); |
|
| 92 | + Argument::type('string'), |
|
| 93 | + Argument::type('array')) |
|
| 94 | + ->shouldBeCalledTimes(1); |
|
| 95 | 95 | |
| 96 | 96 | $this->testedBuildLogger->logFailure($message); |
| 97 | 97 | } |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | $this->mockLogger->log(Argument::type('string'), |
| 107 | - Argument::type('string'), |
|
| 108 | - Argument::withEntry('exception', $exception)) |
|
| 109 | - ->shouldBeCalledTimes(1); |
|
| 107 | + Argument::type('string'), |
|
| 108 | + Argument::withEntry('exception', $exception)) |
|
| 109 | + ->shouldBeCalledTimes(1); |
|
| 110 | 110 | |
| 111 | 111 | $this->testedBuildLogger->logFailure($message, $exception); |
| 112 | 112 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | protected function buildTemp() |
| 42 | 42 | { |
| 43 | - $directory = tempnam(APPLICATION_PATH . '/Tests/temp', 'source'); |
|
| 43 | + $directory = tempnam(APPLICATION_PATH.'/Tests/temp', 'source'); |
|
| 44 | 44 | unlink($directory); |
| 45 | 45 | return $directory; |
| 46 | 46 | } |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $directory = $this->buildTemp(); |
| 51 | 51 | mkdir($directory); |
| 52 | - file_put_contents($directory . '/one.php', '<?php echo "one";'); |
|
| 53 | - file_put_contents($directory . '/two.php', '<?php echo "two";'); |
|
| 54 | - mkdir($directory . '/config'); |
|
| 55 | - file_put_contents($directory . '/config/config.ini', '[config]'); |
|
| 56 | - mkdir($directory . '/views'); |
|
| 57 | - file_put_contents($directory . '/views/index.phtml', '<?php echo "hello";'); |
|
| 52 | + file_put_contents($directory.'/one.php', '<?php echo "one";'); |
|
| 53 | + file_put_contents($directory.'/two.php', '<?php echo "two";'); |
|
| 54 | + mkdir($directory.'/config'); |
|
| 55 | + file_put_contents($directory.'/config/config.ini', '[config]'); |
|
| 56 | + mkdir($directory.'/views'); |
|
| 57 | + file_put_contents($directory.'/views/index.phtml', '<?php echo "hello";'); |
|
| 58 | 58 | $this->directory = $directory; |
| 59 | 59 | return $directory; |
| 60 | 60 | } |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | '/one.php', |
| 74 | 74 | ); |
| 75 | 75 | foreach ($filenames as $filename) { |
| 76 | - if (is_dir($this->directory . $filename)) { |
|
| 77 | - rmdir($this->directory . $filename); |
|
| 78 | - } else if (is_file($this->directory . $filename)) { |
|
| 79 | - unlink($this->directory . $filename); |
|
| 76 | + if (is_dir($this->directory.$filename)) { |
|
| 77 | + rmdir($this->directory.$filename); |
|
| 78 | + } else if (is_file($this->directory.$filename)) { |
|
| 79 | + unlink($this->directory.$filename); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | rmdir($this->directory); |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $this->assertTrue($plugin->execute()); |
| 148 | 148 | |
| 149 | - $this->assertFileExists($path . '/build.phar'); |
|
| 150 | - PHPPhar::loadPhar($path . '/build.phar'); |
|
| 151 | - $this->assertFileEquals($path . '/one.php', 'phar://build.phar/one.php'); |
|
| 152 | - $this->assertFileEquals($path . '/two.php', 'phar://build.phar/two.php'); |
|
| 149 | + $this->assertFileExists($path.'/build.phar'); |
|
| 150 | + PHPPhar::loadPhar($path.'/build.phar'); |
|
| 151 | + $this->assertFileEquals($path.'/one.php', 'phar://build.phar/one.php'); |
|
| 152 | + $this->assertFileEquals($path.'/two.php', 'phar://build.phar/two.php'); |
|
| 153 | 153 | $this->assertFileNotExists('phar://build.phar/config/config.ini'); |
| 154 | 154 | $this->assertFileNotExists('phar://build.phar/views/index.phtml'); |
| 155 | 155 | } |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $this->assertTrue($plugin->execute()); |
| 166 | 166 | |
| 167 | - $this->assertFileExists($path . '/build.phar'); |
|
| 168 | - PHPPhar::loadPhar($path . '/build.phar'); |
|
| 169 | - $this->assertFileEquals($path . '/one.php', 'phar://build.phar/one.php'); |
|
| 170 | - $this->assertFileEquals($path . '/two.php', 'phar://build.phar/two.php'); |
|
| 167 | + $this->assertFileExists($path.'/build.phar'); |
|
| 168 | + PHPPhar::loadPhar($path.'/build.phar'); |
|
| 169 | + $this->assertFileEquals($path.'/one.php', 'phar://build.phar/one.php'); |
|
| 170 | + $this->assertFileEquals($path.'/two.php', 'phar://build.phar/two.php'); |
|
| 171 | 171 | $this->assertFileNotExists('phar://build.phar/config/config.ini'); |
| 172 | - $this->assertFileEquals($path . '/views/index.phtml', 'phar://build.phar/views/index.phtml'); |
|
| 172 | + $this->assertFileEquals($path.'/views/index.phtml', 'phar://build.phar/views/index.phtml'); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | public function testExecuteStub() |
@@ -183,15 +183,15 @@ discard block |
||
| 183 | 183 | STUB; |
| 184 | 184 | |
| 185 | 185 | $path = $this->buildSource(); |
| 186 | - file_put_contents($path . '/stub.php', $content); |
|
| 186 | + file_put_contents($path.'/stub.php', $content); |
|
| 187 | 187 | |
| 188 | 188 | $plugin = $this->getPlugin(array('stub' => 'stub.php')); |
| 189 | 189 | $plugin->getPHPCI()->buildPath = $path; |
| 190 | 190 | |
| 191 | 191 | $this->assertTrue($plugin->execute()); |
| 192 | 192 | |
| 193 | - $this->assertFileExists($path . '/build.phar'); |
|
| 194 | - $phar = new PHPPhar($path . '/build.phar'); |
|
| 193 | + $this->assertFileExists($path.'/build.phar'); |
|
| 194 | + $phar = new PHPPhar($path.'/build.phar'); |
|
| 195 | 195 | $this->assertEquals($content, trim($phar->getStub())); // + trim because PHP adds newline char |
| 196 | 196 | } |
| 197 | 197 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $this->mockBuild->expects($this->any()) |
| 89 | 89 | ->method('getStatus') |
| 90 | - ->will($this->returnCallback(function () use ($self) { |
|
| 90 | + ->will($this->returnCallback(function() use ($self) { |
|
| 91 | 91 | return $self->buildStatus; |
| 92 | 92 | })); |
| 93 | 93 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | $this->testedEmailPlugin->expects($this->any()) |
| 156 | 156 | ->method('sendEmail') |
| 157 | - ->will($this->returnCallback(function ($to, $cc, $subject, $body) use ($self) { |
|
| 157 | + ->will($this->returnCallback(function($to, $cc, $subject, $body) use ($self) { |
|
| 158 | 158 | $self->message['to'][] = $to; |
| 159 | 159 | $self->message['cc'] = $cc; |
| 160 | 160 | $self->message['subject'] = $subject; |