-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
Check warning on line 1 in lib/test/Symfony1ApplicationTestCase.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in lib/test/Symfony1ApplicationTestCase.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in lib/test/Symfony1ApplicationTestCase.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in lib/test/Symfony1ApplicationTestCase.php GitHub Actions / PHP-CS-Fixer
|
||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class Symfony1ApplicationTestCase extends TestCase | ||
{ | ||
public function resetSfConfig() | ||
{ | ||
sfConfig::set('sf_symfony_lib_dir', realpath(__DIR__.'/../lib')); | ||
sfConfig::set('sf_test_cache_dir', sys_get_temp_dir().'/sf_test_project'); | ||
} | ||
|
||
public function getEnvironment() | ||
{ | ||
return 'test'; | ||
} | ||
|
||
public function getDebug() | ||
{ | ||
return true; | ||
} | ||
|
||
public function getEventDispatcher() | ||
{ | ||
return null; | ||
} | ||
|
||
public function getRootDir() | ||
{ | ||
return null; | ||
} | ||
|
||
public function projectSetup(sfApplicationConfiguration $applicationConfiguration) | ||
{ | ||
} | ||
|
||
public function getApplicationConfiguration() | ||
{ | ||
return new TestCaseDrivenApplicationConfiguration( | ||
$this, | ||
$this->getEnvironment(), | ||
$this->getDebug(), | ||
$this->getRootDir(), | ||
$this->getEventDispatcher() | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class Symfony1ProjectTestCase extends TestCase | ||
{ | ||
public function resetSfConfig() | ||
{ | ||
sfConfig::set('sf_symfony_lib_dir', realpath(__DIR__.'/../lib')); | ||
sfConfig::set('sf_test_cache_dir', sys_get_temp_dir().'/sf_test_project'); | ||
} | ||
|
||
public function projectSetup(sfProjectConfiguration $configuration) | ||
{ | ||
} | ||
|
||
public function getEventDispatcher() | ||
{ | ||
return null; | ||
} | ||
|
||
public function getRootDir() | ||
{ | ||
return null; | ||
} | ||
|
||
public function getProjectConfiguration() | ||
{ | ||
return new TestCaseDrivenProjectConfiguration($this, $this->getRootDir(), $this->getEventDispatcher()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
Check warning on line 1 in lib/test/TestCaseDrivenApplicationConfiguration.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in lib/test/TestCaseDrivenApplicationConfiguration.php GitHub Actions / PHP-CS-Fixer
Check warning on line 1 in lib/test/TestCaseDrivenApplicationConfiguration.php GitHub Actions / PHP-CS-Fixer
|
||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
class TestCaseDrivenApplicationConfiguration extends sfApplicationConfiguration implements TestCaseDrivenConfigurationInterface | ||
{ | ||
protected $testCase; | ||
|
||
public function __construct($testCase, $environment, $debug, $rootDir = null, sfEventDispatcher $dispatcher = null) | ||
{ | ||
$this->testCase = $testCase; | ||
parent::__construct($environment, $debug, $rootDir, $dispatcher); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getTestCase() | ||
{ | ||
return $this->testCase; | ||
} | ||
|
||
public function getI18NGlobalDirs() | ||
{ | ||
if (method_exists($this->testCase, 'getI18NGlobalDirs')) { | ||
return $this->testCase->getI18NGlobalDirs(); | ||
} | ||
|
||
return parent::getI18NGlobalDirs(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
class TestCaseDrivenProjectConfiguration extends ProjectConfiguration implements TestCaseDrivenConfigurationInterface | ||
{ | ||
protected $testCase; | ||
|
||
public function __construct($testCase, $rootDir = null, sfEventDispatcher $dispatcher = null) | ||
{ | ||
$this->testCase = $testCase; | ||
|
||
parent::__construct($rootDir, $dispatcher); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getTestCase() | ||
{ | ||
return $this->testCase; | ||
} | ||
} |