/** SONARPLUGINS-1718 */ @Test public void testCommandLineWithStarInArgumentLineProperty() { // Given settings.setProperty( PDEPEND_ARGUMENT_LINE_KEY, "--ignore=**/tests/**,**/jpgraph/**,**/Zend/**"); // Verify assertThat(executor.getCommandLine().get(3)) .isEqualTo("--ignore=**/tests/**,**/jpgraph/**,**/Zend/**"); }
@Test public void testSimpleCommandLine() { List<String> commandLine = executor.getCommandLine(); assertThat(commandLine.get(0)).startsWith("pdepend"); assertThat(commandLine.get(1)) .isEqualTo( "--phpunit-xml=" + new File("target/MockProject/target/logs/pdepend.xml").getAbsolutePath()); assertThat(commandLine.get(2)).isEqualTo("--suffix=php,php3,php4,php5,phtml,inc"); assertThat(commandLine.get(3)).isEqualTo(new File("target/MockProject/src").getAbsolutePath()); }
@Test public void testCommandLineWithSeveralParameters() { // Given settings.setProperty(PDEPEND_EXCLUDE_PACKAGE_KEY, "foo,bar"); settings.setProperty(PDEPEND_WITHOUT_ANNOTATION_KEY, "true"); settings.setProperty(PDEPEND_BAD_DOCUMENTATION_KEY, "true"); settings.setProperty(PDEPEND_ARGUMENT_LINE_KEY, " --foo=bar --foo2=bar2 "); // Verify List<String> commandLine = executor.getCommandLine(); assertThat(commandLine.get(0)).startsWith("pdepend"); assertThat(commandLine.get(1)) .isEqualTo( "--phpunit-xml=" + new File("target/MockProject/target/logs/pdepend.xml").getAbsolutePath()); assertThat(commandLine.get(2)).isEqualTo("--suffix=php,php3,php4,php5,phtml,inc"); assertThat(commandLine.get(3)).isEqualTo("--exclude=foo,bar"); assertThat(commandLine.get(4)).isEqualTo("--bad-documentation"); assertThat(commandLine.get(5)).isEqualTo("--without-annotations"); assertThat(commandLine.get(6)).isEqualTo("--foo=bar"); assertThat(commandLine.get(7)).isEqualTo("--foo2=bar2"); assertThat(commandLine.get(8)).isEqualTo(new File("target/MockProject/src").getAbsolutePath()); }
@Test public void testGetExecutedTool() throws Exception { assertThat(executor.getExecutedTool(), is("PHP Depend")); }