I am experiencing a very weird issue.
I have two classes, one is in App\Projects\github\Units\github_login and the other is App\Projects\github\Schema\github_login
The Schema file is just a scheme which shows the skeletal structure of the file App\Projects\github\Units\github_login.
In fact, it should never ever get loaded and executed, it is just for humans.
However, PHP always executes this file instead of App\Projects\github\Units\github_login
namespace App\Http\Controllers;
use App\Models\Selenium;
use App\Models\Project;
use App\Projects\github\Units\github_login;
class PlayController extends BasePlayController
{
private $github_login;
function __construct()
{
parent::__construct();
$this->github_login = new github_login();
}
/**
* Play a testcase X times.
*
* @param string $Project
* @param string $Unit
* @param string $Scenario
* @param string $Testcase
* @param int $Times
* @param int $Delay
* @return /Illuminate/View/View
*/
public function PlayCase($Project, $Unit, $Scenario, $Testcase, $Times=1, $Delay=3)
{
$SeleniumObj = $this->Selenium;
$Unit = $Project .'_'. $Unit;
switch ($Project) {
case 'github':
switch ($Unit) {
case 'github_login':
switch ($Scenario) {
case 'standard':
$this->callCase(array($this->github_login, 'standard'), $Testcase, $Times, $Delay);
break;
default:
$SeleniumObj->logMessage[$SeleniumObj->index]['TestcaseTitle'] = $Scenario;
$SeleniumObj->setMessage(2,"Das Szenario '<strong>". $Scenario ."</strong>' existiert nicht!", '');
}
break;
}
break;
default:
$SeleniumObj->setTitle('Projekt existiert nicht.');
$SeleniumObj->setMessage(2,'Das Projekt <strong>'. $Project .'</strong> existiert nicht. (Fix: einfach neuen Testfall anlegen)', '');
}
return view('show.report')->with('driver', $SeleniumObj->driver)
->with('ScenarioName', $Scenario)
->with('logMessage', $SeleniumObj->logMessage)
->with('execScriptRet', $SeleniumObj->execScriptRet)
->with('screenshot', $SeleniumObj->screenshot)
->with('PlayAll', false);
}
As you can see in the screenshot, it even loads the right one, but how on earth does it execute the one in folder Schema?
I am making selenium tests btw and use the github login page for start.
UPDATE:
BasePlayController - callCase:
namespace App\Http\Controllers;
use App\Models\Selenium;
class BasePlayController
{
public $Selenium;
function __construct()
{
$this->Selenium = new Selenium();
}
public function callCase($thisFunction, $Testcase, $Times=1, $Delay=1)
{
$SeleniumObj = $this->Selenium;
if (is_numeric($Times)) {
for($i = 1; $i <= $Times; $i++) {
$thisFunction($SeleniumObj, $Testcase);
sleep($Delay);
}
} else {
$SeleniumObj->logMessage[$SeleniumObj->index]['TestcaseTitle'] = 'Falscher Parameter für Times.';
$SeleniumObj->setErrorMessage("Times muss eine Zahl sein! (Gegeben: '<strong>". $Times ."</strong>')", '');
}
}
...
UPDATE 2
Autloader Entry in vendor\composer\autoload_classmap.php
'App\\Projects\\github\\Units\\github_login' => $baseDir . '/app/Projects/github/Schema/github_login.php',
I tried to change it to
'App\\Projects\\github\\Units\\github_login' => $baseDir . '/app/Projects/github/Units/github_login.php',
but it made no difference.

Units\github_loginusesSchema\github_login?