That's possible too, but how can I get that working?
Currently this is my test:
<?php
namespace JeroenvanRensen\MoonPHP\Tests\Resources;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
use JeroenvanRensen\MoonPHP\Tests\TestCase;
class ResourceHelpersTest extends TestCase
{
use RefreshDatabase;
public $model = <<<EOD
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
//
}
EOD;
public $resource = <<<EOD
<?php
namespace App\Resources;
use JeroenvanRensen\MoonPHP\Resource;
use App\Models\Page;
class Page extends Resource
{
public $model = PageModel::class;
}
EOD;
/** @test */
public function the_resource_class_can_find_all_the_resources()
{
$this->withoutExceptionHandling();
Config::set('filesystems.disks.local.root', app_path());
Storage::disk('local')->put('Models/Page.php', $this->model);
Storage::disk('local')->put('Resources/Page.php', $this->resource);
$resource = \App\Resources\Page;
}
}
But of course the \App\Resources\Page class is not found.
Make those two classes as actual files that can be used for testing. How are you expecting to load them in your package? Do you just need to load the all classes in a directory to parse or?