From 7836a8d8c79dfec97e07214495fd77b39ae8b5e1 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 20 Oct 2016 15:40:22 +0200 Subject: use short array syntax Signed-off-by: Morris Jobke --- tests/lib/App/DependencyAnalyzerTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index 684a1b52259..eb1142afd9d 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -256,17 +256,17 @@ class DependencyAnalyzerTest extends TestCase { * @return array */ function providesCommands() { - return array( - array(array(), null), + return [ + [[], null], // grep is known on linux - array(array(), array(array('@attributes' => array('os' => 'Linux'), '@value' => 'grep'))), + [[], [['@attributes' => ['os' => 'Linux'], '@value' => 'grep']]], // grepp is not known on linux - array(array('The command line tool grepp could not be found'), array(array('@attributes' => array('os' => 'Linux'), '@value' => 'grepp'))), + [['The command line tool grepp could not be found'], [['@attributes' => ['os' => 'Linux'], '@value' => 'grepp']]], // we don't care about tools on Windows - we are on Linux - array(array(), array(array('@attributes' => array('os' => 'Windows'), '@value' => 'grepp'))), + [[], [['@attributes' => ['os' => 'Windows'], '@value' => 'grepp']]], // grep is known on all systems - array(array(), 'grep'), - ); + [[], 'grep'], + ]; } /** -- cgit v1.2.3 From ef842ef20a9fb9330173b09c4f889bd2264c8f87 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 19 Oct 2016 23:17:39 +0200 Subject: Ensure $commands being an array - fixes #26073 --- lib/private/App/DependencyAnalyzer.php | 3 +++ tests/lib/App/DependencyAnalyzerTest.php | 1 + 2 files changed, 4 insertions(+) (limited to 'tests') diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 7adb5d1c574..7b48e81f3eb 100644 --- a/lib/private/App/DependencyAnalyzer.php +++ b/lib/private/App/DependencyAnalyzer.php @@ -197,6 +197,9 @@ class DependencyAnalyzer { if (!is_array($commands)) { $commands = array($commands); } + if (isset($commands['@value'])) { + $commands = [$commands]; + } $os = $this->platform->getOS(); foreach ($commands as $command) { if (isset($command['@attributes']['os']) && $command['@attributes']['os'] !== $os) { diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index eb1142afd9d..091479798b3 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -266,6 +266,7 @@ class DependencyAnalyzerTest extends TestCase { [[], [['@attributes' => ['os' => 'Windows'], '@value' => 'grepp']]], // grep is known on all systems [[], 'grep'], + [[], ['@attributes' => ['os' => 'Linux'], '@value' => 'grep']], ]; } -- cgit v1.2.3