Added absolute pathing for unit tests.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Abel Hoogeveen 2021-01-28 16:07:48 +01:00
parent 3f522c55fa
commit 51153520e2
Signed by: abelhooge
GPG Key ID: 387E8DC1F73306FC
4 changed files with 11 additions and 11 deletions

View File

@ -58,7 +58,7 @@ class ControllersTest extends TestCase
public function setUp(): void public function setUp(): void
{ {
$this->controllers = new Controllers(); $this->controllers = new Controllers();
$this->controllers->addComponentPath('controllers'); $this->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers');
} }
/** /**
@ -171,8 +171,8 @@ class ControllersTest extends TestCase
public function testDifferentComponentPathPriority() public function testDifferentComponentPathPriority()
{ {
// Add the directories for this test // Add the directories for this test
$this->controllers->addComponentPath('controllers'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST); $this->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST);
$this->controllers->addComponentPath('controllers'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST); $this->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
// Load the controller and assert it is the correct type // Load the controller and assert it is the correct type
$controller = $this->controllers->get('TestDifferentComponentPathPriority'); $controller = $this->controllers->get('TestDifferentComponentPathPriority');

View File

@ -59,7 +59,7 @@ class ModelsTest extends TestCase
public function setUp(): void public function setUp(): void
{ {
$this->models = new Models(); $this->models = new Models();
$this->models->addComponentPath('models'); $this->models->addComponentPath(dirname(__DIR__) . DS . 'models');
} }
/** /**
@ -172,8 +172,8 @@ class ModelsTest extends TestCase
public function testDifferentComponentPathPriority() public function testDifferentComponentPathPriority()
{ {
// Add the directories for this test // Add the directories for this test
$this->models->addComponentPath('models'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST); $this->models->addComponentPath(dirname(__DIR__) . DS . 'models'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST);
$this->models->addComponentPath('models'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST); $this->models->addComponentPath(dirname(__DIR__) . DS . 'models'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
// Load the model and assert it is the correct type // Load the model and assert it is the correct type
$model = $this->models->get('TestDifferentComponentPathPriority'); $model = $this->models->get('TestDifferentComponentPathPriority');

View File

@ -71,8 +71,8 @@ class RouterTest extends TestCase
$this->config = Factory::getInstance()->config; $this->config = Factory::getInstance()->config;
// Append required routes // Append required routes
Factory::getInstance()->controllers->addComponentPath('controllers'); Factory::getInstance()->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers');
Factory::getInstance()->views->addComponentPath('views'); Factory::getInstance()->views->addComponentPath(dirname(__DIR__) . DS . 'views');
} }
/** /**

View File

@ -65,7 +65,7 @@ class ViewsTest extends TestCase
public function setUp(): void public function setUp(): void
{ {
$this->views = new Views(); $this->views = new Views();
$this->views->addComponentPath('views'); $this->views->addComponentPath(dirname(__DIR__) . DS . 'views');
$this->mockController = $this->getMockBuilder(Controller::class)->getMock(); $this->mockController = $this->getMockBuilder(Controller::class)->getMock();
} }
@ -179,8 +179,8 @@ class ViewsTest extends TestCase
public function testDifferentComponentPathPriority() public function testDifferentComponentPathPriority()
{ {
// Add the directories for this test // Add the directories for this test
$this->views->addComponentPath('views'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST); $this->views->addComponentPath(dirname(__DIR__) . DS . 'views'.DS.'TestDifferentComponentPathPriority'.DS.'Lowest', Priority::LOWEST);
$this->views->addComponentPath('views'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST); $this->views->addComponentPath(dirname(__DIR__) . DS . 'views'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
// Load the view and assert it is the correct type // Load the view and assert it is the correct type
$view = $this->views->get('TestDifferentComponentPathPriority', $this->mockController); $view = $this->views->get('TestDifferentComponentPathPriority', $this->mockController);