-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: additional
opcache
setting in check php.ini (#9032)
* feat: additional opcache setting in check PHP.ini * fix: PHPUnit fails * fix: remark memory_consumption * fix: adjust remark * fix: add argument for opcache only * tests: add argument for opcache only * fix: typo * fix: errors on GA * Update system/Commands/Utilities/PhpIniCheck.php Co-authored-by: kenjis <[email protected]> * Update system/Security/CheckPhpIni.php Co-authored-by: kenjis <[email protected]> * fix: typo * refactor: remark certain provisions * tests: fix remark save_comments * fix: typo --------- Co-authored-by: kenjis <[email protected]>
- Loading branch information
Showing
4 changed files
with
133 additions
and
7 deletions.
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
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
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,74 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CodeIgniter\Commands\Utilities; | ||
|
||
use CodeIgniter\Test\CIUnitTestCase; | ||
use CodeIgniter\Test\StreamFilterTrait; | ||
use PHPUnit\Framework\Attributes\Group; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
#[Group('Others')] | ||
final class PhpIniCheckTest extends CIUnitTestCase | ||
{ | ||
use StreamFilterTrait; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->resetServices(); | ||
parent::setUp(); | ||
} | ||
|
||
protected function tearDown(): void | ||
{ | ||
$this->resetServices(); | ||
parent::tearDown(); | ||
} | ||
|
||
protected function getBuffer(): string | ||
{ | ||
return $this->getStreamFilterBuffer(); | ||
} | ||
|
||
public function testCommandCheckNoArg(): void | ||
{ | ||
command('phpini:check'); | ||
|
||
$result = $this->getBuffer(); | ||
|
||
$this->assertStringContainsString('Directive', $result); | ||
$this->assertStringContainsString('Global', $result); | ||
$this->assertStringContainsString('Current', $result); | ||
$this->assertStringContainsString('Recommended', $result); | ||
$this->assertStringContainsString('Remark', $result); | ||
} | ||
|
||
public function testCommandCheckOpcache(): void | ||
{ | ||
command('phpini:check opcache'); | ||
|
||
$this->assertStringContainsString('opcache.save_comments', $this->getBuffer()); | ||
} | ||
|
||
public function testCommandCheckNoExistsArg(): void | ||
{ | ||
command('phpini:check noexists'); | ||
|
||
$this->assertStringContainsString( | ||
'You must specify a correct argument.', | ||
$this->getBuffer() | ||
); | ||
} | ||
} |
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