Added absolute pathing for unit tests.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3f522c55fa
commit
51153520e2
|
@ -58,7 +58,7 @@ class ControllersTest extends TestCase
|
|||
public function setUp(): void
|
||||
{
|
||||
$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()
|
||||
{
|
||||
// Add the directories for this test
|
||||
$this->controllers->addComponentPath('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.'Lowest', Priority::LOWEST);
|
||||
$this->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
|
||||
|
||||
// Load the controller and assert it is the correct type
|
||||
$controller = $this->controllers->get('TestDifferentComponentPathPriority');
|
||||
|
|
|
@ -59,7 +59,7 @@ class ModelsTest extends TestCase
|
|||
public function setUp(): void
|
||||
{
|
||||
$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()
|
||||
{
|
||||
// Add the directories for this test
|
||||
$this->models->addComponentPath('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.'Lowest', Priority::LOWEST);
|
||||
$this->models->addComponentPath(dirname(__DIR__) . DS . 'models'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
|
||||
|
||||
// Load the model and assert it is the correct type
|
||||
$model = $this->models->get('TestDifferentComponentPathPriority');
|
||||
|
|
|
@ -71,8 +71,8 @@ class RouterTest extends TestCase
|
|||
$this->config = Factory::getInstance()->config;
|
||||
|
||||
// Append required routes
|
||||
Factory::getInstance()->controllers->addComponentPath('controllers');
|
||||
Factory::getInstance()->views->addComponentPath('views');
|
||||
Factory::getInstance()->controllers->addComponentPath(dirname(__DIR__) . DS . 'controllers');
|
||||
Factory::getInstance()->views->addComponentPath(dirname(__DIR__) . DS . 'views');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,7 +65,7 @@ class ViewsTest extends TestCase
|
|||
public function setUp(): void
|
||||
{
|
||||
$this->views = new Views();
|
||||
$this->views->addComponentPath('views');
|
||||
$this->views->addComponentPath(dirname(__DIR__) . DS . 'views');
|
||||
$this->mockController = $this->getMockBuilder(Controller::class)->getMock();
|
||||
}
|
||||
|
||||
|
@ -179,8 +179,8 @@ class ViewsTest extends TestCase
|
|||
public function testDifferentComponentPathPriority()
|
||||
{
|
||||
// Add the directories for this test
|
||||
$this->views->addComponentPath('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.'Lowest', Priority::LOWEST);
|
||||
$this->views->addComponentPath(dirname(__DIR__) . DS . 'views'.DS.'TestDifferentComponentPathPriority'.DS.'Highest', Priority::HIGHEST);
|
||||
|
||||
// Load the view and assert it is the correct type
|
||||
$view = $this->views->get('TestDifferentComponentPathPriority', $this->mockController);
|
||||
|
|
Loading…
Reference in New Issue