Skip to content

Commit 006bce8

Browse files
committed
Test serialized class state
1 parent 0fddc94 commit 006bce8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/framework/tests/Feature/ConfigurableFeaturesTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Hyde\Testing\TestCase;
1010
use Illuminate\Support\Facades\Config;
1111

12+
use function config;
13+
1214
/**
1315
* @covers \Hyde\Facades\Features
1416
*/
@@ -97,6 +99,28 @@ public function testToArrayMethodContainsAllSettingsIncludingFalseValues()
9799
], (new Features)->toArray());
98100
}
99101

102+
public function testSerializedClassState()
103+
{
104+
config(['hyde.features' => [
105+
Features::htmlPages(),
106+
Features::markdownPosts(),
107+
Features::bladePages(),
108+
]]);
109+
110+
$this->assertSame(<<<'JSON'
111+
{
112+
"html-pages": true,
113+
"markdown-posts": true,
114+
"blade-pages": true,
115+
"markdown-pages": false,
116+
"documentation-pages": false,
117+
"darkmode": false,
118+
"documentation-search": false,
119+
"torchlight": false
120+
}
121+
JSON, (new Features)->toJson(JSON_PRETTY_PRINT));
122+
}
123+
100124
public function testFeaturesCanBeMocked()
101125
{
102126
Features::mock('darkmode', true);

0 commit comments

Comments
 (0)