-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to submission time validation of XML files
Add a test which utilizes the submission function of KWTester to submit the same data as the manual validation steps.
- Loading branch information
1 parent
7657cc7
commit b707518
Showing
6 changed files
with
144 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
require_once dirname(__FILE__) . '/cdash_test_case.php'; | ||
|
||
|
||
|
||
class SubmissionValidationTestCase extends KWWebTestCase | ||
{ | ||
protected $PDO; | ||
protected $ConfigFile; | ||
protected $Original; | ||
|
||
public function _construct() | ||
{ | ||
|
||
parent::__construct(); | ||
} | ||
|
||
public function submit($fileName) | ||
{ | ||
$rep = dirname(__FILE__) . '/../../../tests/data/XmlValidation'; | ||
$file = "$rep/$fileName"; | ||
|
||
return $this->submission('InsightExample', $file); | ||
} | ||
|
||
public function testSubmissionValidation() | ||
{ | ||
|
||
$this->ConfigFile = dirname(__FILE__) . '/../../../.env'; | ||
$this->Original = file_get_contents($this->ConfigFile); | ||
#print_r($this->Original); | ||
file_put_contents($this->ConfigFile, "VALIDATE_XML_SUBMISSIONS=true\n", FILE_APPEND | LOCK_EX); | ||
|
||
$this->assertFalse($this->submit("invalid_Configure.xml"), "Submission of invalid_syntax_Build.xml was not succeessful"); | ||
$this->assertFalse($this->submit("invalid_syntax_Build.xml"), "Submission of invalid_syntax_Build.xml was not succeessful"); | ||
$this->assertTrue($this->submit("valid_Build.xml"), "Submission of valid_Build.xml has succeeded"); | ||
|
||
file_put_contents($this->ConfigFile, $this->Original); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters