Commit: 280b673f78282d97239ecc5b5ab9373929a806f9 Author: Allen Truong <v-alt...@microsoft.com> Thu, 19 Dec 2019 15:53:43 -0800 Committer: Christoph M. Becker <cmbecke...@gmx.de> Fri, 17 Jan 2020 14:40:17 +0100 Parents: 354f3d3231ef42426723aefcb70cbd989577b769 Branches: master
Link: http://git.php.net/?p=pftt2.git;a=commitdiff;h=280b673f78282d97239ecc5b5ab9373929a806f9 Log: Updated simplest app scenario (HelloWorld) Changed paths: M cache/util/PEAR/pear/PHPUnit/Framework/Comparator/DOMDocument.php M conf/app/hello_world.groovy M src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java M src/com/mostc/pftt/runner/CliPhpUnitTestCaseRunner.java Diff: diff --git a/cache/util/PEAR/pear/PHPUnit/Framework/Comparator/DOMDocument.php b/cache/util/PEAR/pear/PHPUnit/Framework/Comparator/DOMDocument.php index d4ad6eb6..514d0500 100644 --- a/cache/util/PEAR/pear/PHPUnit/Framework/Comparator/DOMDocument.php +++ b/cache/util/PEAR/pear/PHPUnit/Framework/Comparator/DOMDocument.php @@ -84,7 +84,7 @@ class PHPUnit_Framework_Comparator_DOMDocument extends PHPUnit_Framework_Compara * fails. Contains information about the * specific errors that lead to the failure. */ - public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE, &$processed = Array()) { if ($expected->C14N() !== $actual->C14N()) { throw new PHPUnit_Framework_ComparisonFailure( diff --git a/conf/app/hello_world.groovy b/conf/app/hello_world.groovy index 7d6ece6b..696a1f1c 100644 --- a/conf/app/hello_world.groovy +++ b/conf/app/hello_world.groovy @@ -6,3 +6,41 @@ def describe() { def scenarios() { new HelloWorldScenario() } + +class HelloWorldPhpUnitTestPack extends PhpUnitSourceTestPack { + + @Override + public String getNameAndVersionString() { + return "HelloWorld-Tests"; + } + + @Override + protected String getSourceRoot(ConsoleManager cm, AHost host) { + return host.getPfttDir()+"/cache/working/helloworld"; + } + + @Override + public boolean isDevelopment() { + return false; + } + + @Override + public boolean isFileNameATest(String file_name) { + return file_name.endsWith(".php"); + } + + protected void readTestFile(final int max_read_count, String rel_test_file_name, String abs_test_file_name, PhpUnitDist php_unit_dist, List<PhpUnitTestCase> test_cases, File file) throws IOException { + super.readTestFile(max_read_count, rel_test_file_name, abs_test_file_name, php_unit_dist, test_cases, file); + } + + @Override + protected boolean openAfterInstall(ConsoleManager cm, AHost host) throws Exception { + // Adds the test directory, other parameter is empty since there is no bootstrap file + addPhpUnitDist(getRoot()+"/tests", ""); + return true; + } // end public boolean openAfterInstall +} + +def getPhpUnitSourceTestPack() { + return new HelloWorldPhpUnitTestPack(); +} \ No newline at end of file diff --git a/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java b/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java index 931c3123..3a06777d 100644 --- a/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java +++ b/src/com/mostc/pftt/model/app/PhpUnitSourceTestPack.java @@ -292,7 +292,8 @@ public abstract class PhpUnitSourceTestPack extends ApplicationSourceTestPack<Ph if (test_names!=null) { boolean skip = true; for ( String test_name : test_names ) { - if (lc_test_file_name.contains(test_name)) { + String standardized_test_name = test_name.replace('\\', '/').toLowerCase(); + if (lc_test_file_name.contains(standardized_test_name)) { skip = false; break; } diff --git a/src/com/mostc/pftt/runner/CliPhpUnitTestCaseRunner.java b/src/com/mostc/pftt/runner/CliPhpUnitTestCaseRunner.java index d8377d5e..388e2517 100644 --- a/src/com/mostc/pftt/runner/CliPhpUnitTestCaseRunner.java +++ b/src/com/mostc/pftt/runner/CliPhpUnitTestCaseRunner.java @@ -33,7 +33,6 @@ public class CliPhpUnitTestCaseRunner extends AbstractPhpUnitTestCaseRunner { } private void doExecute(String template_file, String ini_dir) throws Exception { - ini_dir = "C:\\php-sdk\\php-7.0.4-nts-Win32-VC14-x86\\php.ini"; // TODO temp running_test_handle = host.execThread( build.getPhpExe()+" -c "+ini_dir+" "+template_file, env,