From ecb4e441c42fc8cdd52c14a5c5e5124077596d92 Mon Sep 17 00:00:00 2001 From: Christian Leo-Pernold Date: Wed, 6 Mar 2024 10:17:42 +0100 Subject: [PATCH] Add test. Update method to return the correct name. --- phpunit.xml | 48 ++++++++++------------- phpunit.xml.bak | 29 ++++++++++++++ src/FeatureGroups/DefaultFeatureGroup.php | 2 +- tests/DirectiveTest.php | 7 ++++ 4 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 phpunit.xml.bak diff --git a/phpunit.xml b/phpunit.xml index 1cbc5be..aa668c7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,29 +1,23 @@ - - - - src - - - - - - - - - - tests - - - - - + + + + + + + + + + + tests + + + + + + + + src + + diff --git a/phpunit.xml.bak b/phpunit.xml.bak new file mode 100644 index 0000000..1cbc5be --- /dev/null +++ b/phpunit.xml.bak @@ -0,0 +1,29 @@ + + + + + src + + + + + + + + + + tests + + + + + + diff --git a/src/FeatureGroups/DefaultFeatureGroup.php b/src/FeatureGroups/DefaultFeatureGroup.php index 1a57d2c..c6ac4b8 100644 --- a/src/FeatureGroups/DefaultFeatureGroup.php +++ b/src/FeatureGroups/DefaultFeatureGroup.php @@ -1152,7 +1152,7 @@ public function browserSupportUrl(): string Directive::XR_SPATIAL_TRACKING, Directive::XR, Directive::VR => new class extends Directive { public function name(): string { - return 'vr'; + return Directive::XR_SPATIAL_TRACKING; } public function specificationName(): string diff --git a/tests/DirectiveTest.php b/tests/DirectiveTest.php index 8b23911..42fc421 100644 --- a/tests/DirectiveTest.php +++ b/tests/DirectiveTest.php @@ -36,4 +36,11 @@ public function it_can_add_an_rule(): void $this->assertCount(1, $directive->rules()); $this->assertSame(Value::SELF, $directive->rules()[0]); } + + #[Test] + public function xr_spatial_tracking_adds_the_correct_header_directive_instead_of_the_deprecated_one(): void + { + $directive = Directive::make(Directive::XR_SPATIAL_TRACKING); + $this->assertSame(Directive::XR_SPATIAL_TRACKING, $directive->name()); + } }