%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11584/cwd/html/ppaobm/vendor/dominus77/yii2-sweetalert2-widget/tests/functional/ |
Upload File : |
<?php namespace tests; use yii\helpers\ArrayHelper; use yii\web\View; /** * Class TestCase * @package tests */ abstract class TestCase extends \PHPUnit\Framework\TestCase { public static $params; /** * Mock application prior running tests. */ protected function setUp() { $this->mockWebApplication( [ 'components' => [ 'request' => [ 'class' => 'yii\web\Request', 'url' => '/test', 'enableCsrfValidation' => false, ], 'response' => [ 'class' => 'yii\web\Response', ], ], ] ); } /** * Clean up after test. * By default the application created with [[mockApplication]] will be destroyed. */ protected function tearDown() { parent::tearDown(); $this->destroyApplication(); } /** * @param array $config * @param string $appClass */ protected function mockApplication($config = [], $appClass = '\yii\console\Application') { new $appClass( ArrayHelper::merge( [ 'id' => 'testapp', 'basePath' => __DIR__, 'vendorPath' => $this->getVendorPath(), ], $config ) ); } /** * @param array $config * @param string $appClass */ protected function mockWebApplication($config = [], $appClass = '\yii\web\Application') { new $appClass( ArrayHelper::merge( [ 'id' => 'testapp', 'basePath' => __DIR__, 'vendorPath' => $this->getVendorPath(), 'aliases' => [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', ], 'components' => [ 'request' => [ 'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq', 'scriptFile' => __DIR__ . '/index.php', 'scriptUrl' => '/index.php', ], 'assetManager' => [ 'class' => 'tests\AssetManager', 'basePath' => '@tests/assets', 'baseUrl' => '/', ] ] ], $config ) ); } /** * @return string */ protected function getVendorPath() { return dirname(dirname(__DIR__)) . '/vendor'; } /** * Destroys application in Yii::$app by setting it to null. */ protected function destroyApplication() { \Yii::$app = null; } /** * Creates a view for testing purposes * * @return View */ protected function getView() { $view = new View(); $view->setAssetManager( new AssetManager( [ 'basePath' => '@tests/assets', 'baseUrl' => '/', ] ) ); return $view; } /** * Asserting two strings equality ignoring line endings * * @param string $expected * @param string $actual */ public function assertEqualsWithoutLE($expected, $actual) { $expected = str_replace("\r\n", "\n", $expected); $actual = str_replace("\r\n", "\n", $actual); $this->assertEquals($expected, $actual); } }