vip-scanner icon indicating copy to clipboard operation
vip-scanner copied to clipboard

When java is missing, phpunit tests fail with other error

Open gmisura opened this issue 11 years ago • 2 comments

If you run the phpunit tests without java installed on your system, you get

1) JavaScriptLintTest::testJavaScriptSyntaxError
Failed asserting that true is false.

/srv/www/wp-content/plugins/vip-scanner/tests/checks/test-JavaScriptLintCheck.php:27

2) JavaScriptLintTest::testJavaScriptCorrectSyntax
Failed asserting that an array does not contain 'yuicompressor'.

/srv/www/wp-content/plugins/vip-scanner/tests/checks/test-JavaScriptLintCheck.php:52

Instead, I would have expected to see the output from JavaScriptLintCheck.php:23

            $this->add_error( 'yuicompressor', 'YUI Compressor', BaseScanner::LEVEL_WARNING, null, array( 'Java is not present on this system - as such, the YUI Compressor wasn\'t performed on this theme.') );

gmisura avatar Dec 09 '14 06:12 gmisura

Are you running vip-scanner on Windows? is_java_installed() uses the which command, which is probably not available on Windows...

ockham avatar Dec 09 '14 20:12 ockham

I'm on windows, but running in a VIP-Quickstart VM env, so the 'which' command is available.

gmisura avatar Dec 26 '14 05:12 gmisura