-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#13439] - Work on traits and fixtures
- Loading branch information
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon\Test\Fixtures\Traits; | ||
|
||
use UnitTester; | ||
|
||
/** | ||
* Trait RedisTrait | ||
* | ||
* @package Phalcon\Test\Fixtures\Traits | ||
*/ | ||
trait ApcuTrait | ||
{ | ||
public function _before(UnitTester $I) | ||
{ | ||
$I->checkExtensionIsLoaded('apcu'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon\Test\Fixtures\Traits; | ||
|
||
use UnitTester; | ||
|
||
/** | ||
* Trait FileTrait | ||
* | ||
* @package Phalcon\Test\Fixtures\Traits\Cache | ||
*/ | ||
trait LibmemcachedTrait | ||
{ | ||
/** | ||
* @param UnitTester $I | ||
*/ | ||
public function _before(UnitTester $I) | ||
{ | ||
$I->checkExtensionIsLoaded('memcached'); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
protected function getOptions(): array | ||
{ | ||
return [ | ||
'client' => [], | ||
'servers' => [ | ||
[ | ||
'host' => env('DATA_MEMCACHED_HOST', '127.0.0.1'), | ||
'port' => env('DATA_MEMCACHED_PORT', 11211), | ||
'weight' => env('DATA_MEMCACHED_WEIGHT', 0), | ||
], | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters