guys. I have two Unit Tests Classes in CakePhp:
<?php
App::import('Vendor/Laravel', 'Api');
class UserApi extends LaravelApi {
And
<?php
App::uses('Api', 'Vendor/Laravel');
App::import('Vendor/Laravel', 'Api');
App::import('Component', 'Session');
class LaravelApiTest extends CakeTestCase {
When I run my unit test (I will call it AllApp.php) that should run these two tests (and some other too), I get the message
Fatal Error Error: Cannot declare class LaravelApi, because the name is already in use in [/var/www/html/app/Vendor/Laravel/Api.php, line 9]
I have tried by removing one of the two App:import('Vendor/Laravel', 'Api'); and "AllApp.php" runs fine, but of course, the individual test I modified fails because:
Error: Class 'LaravelApi' not found
I think it is because these two files are not run at the same time when I run the individual test, but when I run them with "AllApp" the two files are loaded and the class gets "required" two times (even thought I think App::import is similar to "require_once"). Can anyone help me with this?