OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
firebase-php
/
tests
/
Unit
/
RemoteConfig
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:44 AM
rwxr-xr-x
📄
ApiClientTest.php
2.47 KB
08/12/2024 10:35:43 AM
rw-r--r--
📄
ConditionTest.php
1.59 KB
08/12/2024 10:35:43 AM
rw-r--r--
📄
ConditionalValueTest.php
953 bytes
08/12/2024 10:35:43 AM
rw-r--r--
📄
DefaultValueTest.php
1.49 KB
08/12/2024 10:35:43 AM
rw-r--r--
📄
ParameterGroupTest.php
867 bytes
08/12/2024 10:35:43 AM
rw-r--r--
📄
ParameterTest.php
1.18 KB
08/12/2024 10:35:43 AM
rw-r--r--
📄
TagColorTest.php
478 bytes
08/12/2024 10:35:43 AM
rw-r--r--
📄
TemplateTest.php
3.61 KB
08/12/2024 10:35:43 AM
rw-r--r--
Editing: ConditionTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Tests\Unit\RemoteConfig; use Kreait\Firebase\RemoteConfig\Condition; use Kreait\Firebase\RemoteConfig\TagColor; use Kreait\Firebase\Tests\UnitTestCase; /** * @internal */ final class ConditionTest extends UnitTestCase { /** * @dataProvider valueProvider * * @param string|TagColor|null $tagColor */ public function testCreateCondition(string $name, ?string $expression = null, $tagColor = null): void { $condition = Condition::named($name); if ($expression) { $condition = $condition->withExpression($expression); } if ($tagColor) { $condition = $condition->withTagColor($tagColor); } $this->assertSame($name, $condition->name()); $expected = [ 'name' => $name, 'expression' => $expression ?: 'false', 'tagColor' => $tagColor ? (string) $tagColor : null, ]; $this->assertEquals(\array_filter($expected), $condition->jsonSerialize()); $this->assertEquals($condition, Condition::fromArray($expected)); } /** * @return array<string, array<int, mixed>> */ public function valueProvider(): array { return [ 'color as string' => ['name', 'expression', TagColor::GREEN], 'color as object' => ['name', 'expression', new TagColor(TagColor::ORANGE)], 'no color' => ['name', 'expression', null], 'no expression, no color' => ['name', null, null], ]; } }