protected void checkTestResult(PdttFileExt testFile, IStructuredDocument structuredDocument) {
    List<FileInfo> files = testFile.getExpectedFiles();
    for (FileInfo expFile : files) {
      IFile file = project.findFile(expFile.getName());
      assertTrue(file.exists());

      String content = structuredDocument.get();

      // String newLine = System.getProperty("line.separator");
      // content = content.replaceAll(newLine, "").replaceAll(" ", "");
      // content = content.replaceAll("\n", "").replaceAll(" ", "");

      String diff = PHPCoreTests.compareContentsIgnoreWhitespace(expFile.getContents(), content);
      if (diff != null) {
        fail(diff);
      }
    }
  }
  @Test
  public void test(String fileName) {
    PdttFileExt testFile = filesMap.get(fileName);
    IFile file = project.findFile(testFile.getTestFiles().get(0).getName());

    IStructuredModel model = null;
    try {
      model = createUnManagedStructuredModelFor(file);
    } catch (IOException e) {
      fail(e.getMessage());
    } catch (CoreException e) {
      fail(e.getMessage());
    }
    assertNotNull(model);

    IStructuredDocument structuredDocument = model.getStructuredDocument();
    assertNotNull(structuredDocument);

    int start = Integer.valueOf(testFile.getConfig().get("start"));

    int length = Integer.valueOf(testFile.getConfig().get("length"));

    String visibility = testFile.getConfig().get("visibility");

    ExtractFunctionRefactoring processor =
        new ExtractFunctionRefactoring(
            DLTKCore.createSourceModuleFrom(file), structuredDocument, start, length);

    if ("default".equals(visibility)) {
      processor.setVisibility(Modifiers.AccDefault);
    }

    if ("public".equals(visibility)) {
      processor.setVisibility(Modifiers.AccPublic);
    }

    if ("prvate".equals(visibility)) {
      processor.setVisibility(Modifiers.AccPrivate);
    }

    if ("protected".equals(visibility)) {
      processor.setVisibility(Modifiers.AccProtected);
    }

    processor.setNewFunctionName(testFile.getConfig().get("newName"));

    checkInitCondition(processor);
    performChange(processor);
    checkTestResult(testFile, structuredDocument);
  }