PhpValueProviderFactory implements ValueProviderFactory { @Override public ValueProvider newInstance(FolderEntry projectFolder) { return new PhpValueProvider(projectFolder); }  @Override ValueProvider newInstance(FolderEntry projectFolder); static final String PHP_EXTESION; }
@Test public void testGetValuesWhenProjectContainsPhpFiles() throws Exception { Project phpProject = pm.createProject(workspace, "phpProject", new ProjectConfig("test project", "php", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = phpProject.getBaseFolder(); baseFolder.createFile("test.php", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = phpValueProviderFactory.newInstance(baseFolder).getValues(HAS_PHP_FILES); Assert.assertNotNull(values); Assert.assertFalse(values.isEmpty()); assertEquals(1, values.size()); }
@Test public void testGetValuesWhenProjectNotContainsPhpFiles() throws Exception { Project phpProject = pm.createProject(workspace, "phpProject", new ProjectConfig("test project", "php", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = phpProject.getBaseFolder(); FolderEntry firstFolder = baseFolder.createFolder("firstFolder"); FolderEntry secondFolder = baseFolder.createFolder("secondFolder"); firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN); secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = phpValueProviderFactory.newInstance(baseFolder).getValues(HAS_PHP_FILES); Assert.assertNotNull(values); Assert.assertTrue(values.isEmpty()); }