@@ -28,7 +28,7 @@ |
||
| 28 | 28 | protected $pluginInfo = null; |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * @param $dirPath |
|
| 31 | + * @param string $dirPath |
|
| 32 | 32 | * @return FilesPluginInformation |
| 33 | 33 | */ |
| 34 | 34 | public static function newFromDir($dirPath) |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | public function getPluginClasses() |
| 70 | 70 | { |
| 71 | 71 | return array_map( |
| 72 | - function (\stdClass $plugin) { |
|
| 72 | + function(\stdClass $plugin) { |
|
| 73 | 73 | return $plugin->class; |
| 74 | 74 | }, |
| 75 | 75 | $this->getInstalledPlugins() |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | preg_match('#namespace +([A-Za-z\\\\]+);#i', $contents, $matches); |
| 130 | 130 | $namespace = $matches[1]; |
| 131 | 131 | |
| 132 | - return $namespace . '\\' . $className; |
|
| 132 | + return $namespace.'\\'.$className; |
|
| 133 | 133 | } else { |
| 134 | 134 | return null; |
| 135 | 135 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * @param $url |
|
| 66 | + * @param string $url |
|
| 67 | 67 | */ |
| 68 | 68 | public function setUrl($url) |
| 69 | 69 | { |
@@ -1,11 +1,11 @@ discard block |
||
| 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 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function getBuildUrl() |
| 201 | 201 | { |
| 202 | - return $this->url . 'build/view/' . $this->build->getId(); |
|
| 202 | + return $this->url . 'build/view/' . $this->build->getId(); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function getName() |
| 120 | 120 | { |
| 121 | - return $this->project->getTitle() . ' / ' . $this->branch; |
|
| 121 | + return $this->project->getTitle().' / '.$this->branch; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function getBuildUrl() |
| 201 | 201 | { |
| 202 | - return $this->url . 'build/view/' . $this->build->getId(); |
|
| 202 | + return $this->url.'build/view/'.$this->build->getId(); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -117,6 +117,10 @@ |
||
| 117 | 117 | return $config; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | + /** |
|
| 121 | + * @param string $param |
|
| 122 | + * @param \PHPUnit_Framework_MockObject_MockBuilder $dialog |
|
| 123 | + */ |
|
| 120 | 124 | protected function executeWithoutParam($param = null, $dialog) |
| 121 | 125 | { |
| 122 | 126 | // Clean result variables. |
@@ -35,14 +35,14 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | // We check that there's no interaction with user. |
| 37 | 37 | $dialog = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\DialogHelper') |
| 38 | - ->setMethods(array( |
|
| 39 | - 'ask', |
|
| 40 | - 'askConfirmation', |
|
| 41 | - 'askAndValidate', |
|
| 42 | - 'askHiddenResponse', |
|
| 43 | - 'askHiddenResponseAndValidate', |
|
| 44 | - )) |
|
| 45 | - ->getMock(); |
|
| 38 | + ->setMethods(array( |
|
| 39 | + 'ask', |
|
| 40 | + 'askConfirmation', |
|
| 41 | + 'askAndValidate', |
|
| 42 | + 'askHiddenResponse', |
|
| 43 | + 'askHiddenResponseAndValidate', |
|
| 44 | + )) |
|
| 45 | + ->getMock(); |
|
| 46 | 46 | |
| 47 | 47 | return $dialog; |
| 48 | 48 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | if (!is_null($exclude)) { |
| 114 | - unset($config[$exclude]); |
|
| 114 | + unset($config[$exclude]); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | return $config; |
@@ -72,12 +72,12 @@ |
||
| 72 | 72 | $command->expects($this->once())->method('verifyDatabaseDetails')->willReturn(true); |
| 73 | 73 | $command->expects($this->once())->method('setupDatabase')->willReturn(true); |
| 74 | 74 | $command->expects($this->once())->method('createAdminUser')->will( |
| 75 | - $this->returnCallback(function ($adm) use ($self) { |
|
| 75 | + $this->returnCallback(function($adm) use ($self) { |
|
| 76 | 76 | $self->admin = $adm; |
| 77 | 77 | }) |
| 78 | 78 | ); |
| 79 | 79 | $command->expects($this->once())->method('writeConfigFile')->will( |
| 80 | - $this->returnCallback(function ($cfg) use ($self) { |
|
| 80 | + $this->returnCallback(function($cfg) use ($self) { |
|
| 81 | 81 | $self->config = $cfg; |
| 82 | 82 | }) |
| 83 | 83 | ); |
@@ -209,6 +209,9 @@ |
||
| 209 | 209 | ); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | + /** |
|
| 213 | + * @param string $pluginName |
|
| 214 | + */ |
|
| 212 | 215 | protected function getFakePluginClassName($pluginName) |
| 213 | 216 | { |
| 214 | 217 | $pluginNamespace = '\\Tests\\PHPCI\\Plugin\\Util\\Fake\\'; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function testAddConfigFromFile_ReturnsTrueForValidFile() |
| 151 | 151 | { |
| 152 | 152 | $result = $this->testedFactory->addConfigFromFile( |
| 153 | - realpath(__DIR__ . "/ExamplePluginConfig.php") |
|
| 153 | + realpath(__DIR__."/ExamplePluginConfig.php") |
|
| 154 | 154 | ); |
| 155 | 155 | |
| 156 | 156 | $this->assertTrue($result); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | public function testAddConfigFromFile_RegistersResources() |
| 160 | 160 | { |
| 161 | 161 | $this->testedFactory->addConfigFromFile( |
| 162 | - realpath(__DIR__ . "/ExamplePluginConfig.php") |
|
| 162 | + realpath(__DIR__."/ExamplePluginConfig.php") |
|
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | 165 | $pluginClass = $this->getFakePluginClassName('ExamplePluginWithSingleRequiredArg'); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $self = $this; |
| 182 | 182 | |
| 183 | 183 | $this->testedFactory->registerResource( |
| 184 | - function () use ($self) { |
|
| 184 | + function() use ($self) { |
|
| 185 | 185 | return $self->getMock( |
| 186 | 186 | 'PHPCI\Builder', |
| 187 | 187 | array(), |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | 197 | $this->testedFactory->registerResource( |
| 198 | - function () use ($self) { |
|
| 198 | + function() use ($self) { |
|
| 199 | 199 | return $self->getMock( |
| 200 | 200 | 'PHPCI\Model\Build', |
| 201 | 201 | array(), |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | $pluginNamespace = '\\Tests\\PHPCI\\Plugin\\Util\\Fake\\'; |
| 215 | 215 | |
| 216 | - return $pluginNamespace . $pluginName; |
|
| 216 | + return $pluginNamespace.$pluginName; |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
@@ -116,6 +116,9 @@ |
||
| 116 | 116 | |
| 117 | 117 | abstract public function testIsAvailable(); |
| 118 | 118 | |
| 119 | + /** |
|
| 120 | + * @return string |
|
| 121 | + */ |
|
| 119 | 122 | abstract public function getTestCommand(); |
| 120 | 123 | |
| 121 | 124 | protected function tearDown() |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | date_default_timezone_set('UTC'); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -$configFile = dirname(__FILE__) . '/PHPCI/config.yml'; |
|
| 18 | +$configFile = dirname(__FILE__).'/PHPCI/config.yml'; |
|
| 19 | 19 | $configEnv = getenv('phpci_config_file'); |
| 20 | 20 | $usingCustomConfigFile = false; |
| 21 | 21 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // If composer has not been run, fail at this point and tell the user to install: |
| 36 | -if (!file_exists(dirname(__FILE__) . '/vendor/autoload.php') && defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) { |
|
| 36 | +if (!file_exists(dirname(__FILE__).'/vendor/autoload.php') && defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) { |
|
| 37 | 37 | $message = 'Please install PHPCI with "composer install" (or "php composer.phar install"'; |
| 38 | 38 | $message .= ' for Windows) before using console'; |
| 39 | 39 | |
@@ -42,19 +42,19 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Load Composer autoloader: |
| 45 | -require_once(dirname(__FILE__) . '/vendor/autoload.php'); |
|
| 45 | +require_once(dirname(__FILE__).'/vendor/autoload.php'); |
|
| 46 | 46 | |
| 47 | 47 | \PHPCI\ErrorHandler::register(); |
| 48 | 48 | |
| 49 | 49 | if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) { |
| 50 | - $loggerConfig = LoggerConfig::newFromFile(__DIR__ . "/loggerconfig.php"); |
|
| 50 | + $loggerConfig = LoggerConfig::newFromFile(__DIR__."/loggerconfig.php"); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load configuration if present: |
| 54 | 54 | $conf = array(); |
| 55 | 55 | $conf['b8']['app']['namespace'] = 'PHPCI'; |
| 56 | 56 | $conf['b8']['app']['default_controller'] = 'Home'; |
| 57 | -$conf['b8']['view']['path'] = dirname(__FILE__) . '/PHPCI/View/'; |
|
| 57 | +$conf['b8']['view']['path'] = dirname(__FILE__).'/PHPCI/View/'; |
|
| 58 | 58 | $conf['using_custom_file'] = $usingCustomConfigFile; |
| 59 | 59 | |
| 60 | 60 | $config = new b8\Config($conf); |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @ticket 781 |
| 71 | 71 | */ |
| 72 | -$localVarsFile = dirname(__FILE__) . '/local_vars.php'; |
|
| 72 | +$localVarsFile = dirname(__FILE__).'/local_vars.php'; |
|
| 73 | 73 | if (is_readable($localVarsFile)) { |
| 74 | 74 | require_once $localVarsFile; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | -require_once(dirname(__FILE__) . '/vars.php'); |
|
| 77 | +require_once(dirname(__FILE__).'/vars.php'); |
|
| 78 | 78 | |
| 79 | 79 | \PHPCI\Helper\Lang::init($config); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @link https://www.phptesting.org/ |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -require_once(dirname(__FILE__) . '/bootstrap.php'); |
|
| 11 | +require_once(dirname(__FILE__).'/bootstrap.php'); |
|
| 12 | 12 | |
| 13 | 13 | $writeServers = $config->get('b8.database.servers.write'); |
| 14 | 14 | |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | + array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | + array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | + array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | + array( 'db' => 'country', 'dt' => 4 ) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
| 40 | 40 | $sql_details = array( |
| 41 | - 'user' => '', |
|
| 42 | - 'pass' => '', |
|
| 43 | - 'db' => '', |
|
| 44 | - 'host' => '' |
|
| 41 | + 'user' => '', |
|
| 42 | + 'pass' => '', |
|
| 43 | + 'db' => '', |
|
| 44 | + 'host' => '' |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array('db' => 'id', 'dt' => 0), |
|
| 33 | + array('db' => 'firstname', 'dt' => 1), |
|
| 34 | + array('db' => 'surname', 'dt' => 2), |
|
| 35 | + array('db' => 'zip', 'dt' => 3), |
|
| 36 | + array('db' => 'country', 'dt' => 4) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * server-side, there is no need to edit below this line. |
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | -require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
|
| 53 | +require('../../../../examples/server_side/scripts/ssp.class.php'); |
|
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | protected function findGlobalBinary($binary) |
| 24 | 24 | { |
| 25 | - return trim(shell_exec('which ' . $binary)); |
|
| 25 | + return trim(shell_exec('which '.$binary)); |
|
| 26 | 26 | } |
| 27 | 27 | } |