Moved php unit tests to unit_tests/php dir

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-12-09 08:19:55 +00:00
parent 9898b749c7
commit 0659564b32
5 changed files with 17 additions and 6 deletions

View File

@ -2,7 +2,11 @@
<phpunit colors="true"> <phpunit colors="true">
<testsuites> <testsuites>
<testsuite name="Application Test Suite"> <testsuite name="Application Test Suite">
<directory>./tests</directory> <directory>./unit_tests/php</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<php>
<env name="DIR_BASE" value="webui/" />
<env name="TEST_FILES_DIR" value="test_files/" />
</php>
</phpunit> </phpunit>

View File

@ -2,8 +2,10 @@
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
include_once("webui/system/model.php"); define('DIR_BASE', $_ENV['DIR_BASE']);
include_once("webui/model/search/search.php");
include_once(DIR_BASE . "system/model.php");
include_once(DIR_BASE . "model/search/search.php");
final class SearchSearchTest extends TestCase { final class SearchSearchTest extends TestCase {

View File

@ -2,7 +2,10 @@
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
require_once dirname(dirname(__FILE__)) . '/webui/system/helper/mime.php'; define('DIR_BASE', $_ENV['DIR_BASE']);
define('TEST_FILES_DIR', $_ENV['TEST_FILES_DIR']);
require_once DIR_BASE . 'system/helper/mime.php';
final class MailParserTest extends TestCase { final class MailParserTest extends TestCase {
@ -26,7 +29,7 @@ final class MailParserTest extends TestCase {
* @dataProvider providerTestParseMessage * @dataProvider providerTestParseMessage
*/ */
public function test_parse_message($input, $expected_part_count, $expected_body) { public function test_parse_message($input, $expected_part_count, $expected_body) {
$message = file_get_contents(dirname(dirname(__FILE__)) . "/test_files/" . $input); $message = file_get_contents(TEST_FILES_DIR . $input);
Piler_Mime_Decode::ParseMessage($message, $parts); Piler_Mime_Decode::ParseMessage($message, $parts);
$this->assertEquals(count($parts), $expected_part_count); $this->assertEquals(count($parts), $expected_part_count);

View File

@ -7,7 +7,9 @@ define(THIS_IS_A_TEST, 'This is a test');
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
require_once dirname(dirname(__FILE__)) . '/webui/system/helper/mime.php'; define('DIR_BASE', $_ENV['DIR_BASE']);
require_once DIR_BASE . 'system/helper/mime.php';
final class SplitMessageTest extends TestCase { final class SplitMessageTest extends TestCase {