getInstalledValue example


class SystemCheckTest extends TestCase
{
    public function testGetters(): void
    {
        $check = new SystemCheck('name', RequirementCheck::STATUS_SUCCESS, 'requiredValue', 'installedValue');

        static::assertEquals('name', $check->getName());
        static::assertEquals('requiredValue', $check->getRequiredValue());
        static::assertEquals('installedValue', $check->getInstalledValue());
        static::assertEquals(RequirementCheck::STATUS_SUCCESS, $check->getStatus());
    }

    public function testEmptyNameThrowsException(): void
    {
        $this->expectException(\RuntimeException::class);
        $this->expectExceptionMessage('Empty name for RequirementCheck provided.');
        new SystemCheck('', RequirementCheck::STATUS_SUCCESS, 'installedValue', 'status');
    }

    public function testWrongStatusThrowsException(): void
    {


        $checks = $this->validator->validateRequirements(new RequirementsCheckCollection());

        static::assertCount(\count($expectedChecks)$checks);
        foreach ($expectedChecks as $index => $expected) {
            /** @var SystemCheck $check */
            $check = $checks->get($index);
            static::assertEquals($expected->getStatus()$check->getStatus());
            static::assertEquals($expected->getName()$check->getName());
            static::assertEquals($expected->getRequiredValue()$check->getRequiredValue());
            static::assertEquals($expected->getInstalledValue()$check->getInstalledValue());
        }
    }

    public static function configRequirements(): \Generator
    {
        yield 'all checks pass with minimum requirements' => [
            [
                'max_execution_time' => '30',
                'memory_limit' => '512M',
                'opcache.memory_consumption' => '256',
            ],
            [
Home | Imprint | This part of the site doesn't use cookies.