Skip to content

Commit df76ecb

Browse files
committed
Fix PHPUnit test, remove unneeded test (function is dynamic)
1 parent 83dae09 commit df76ecb

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

tests/SPC/util/GlobalEnvManagerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ protected function setUp(): void
2323
'SPC_TARGET' => getenv('SPC_TARGET'),
2424
'SPC_LIBC' => getenv('SPC_LIBC'),
2525
];
26+
// Temporarily set private GlobalEnvManager::$initialized to false (use reflection)
27+
$reflection = new \ReflectionClass(GlobalEnvManager::class);
28+
$property = $reflection->getProperty('initialized');
29+
$property->setValue(null, false);
2630
}
2731

2832
protected function tearDown(): void
@@ -35,6 +39,10 @@ protected function tearDown(): void
3539
putenv("{$key}={$value}");
3640
}
3741
}
42+
// Temporarily set private GlobalEnvManager::$initialized to false (use reflection)
43+
$reflection = new \ReflectionClass(GlobalEnvManager::class);
44+
$property = $reflection->getProperty('initialized');
45+
$property->setValue(null, true);
3846
}
3947

4048
public function testGetInitializedEnv(): void

tests/SPC/util/SPCTargetTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ protected function tearDown(): void
3434
}
3535
}
3636

37-
/**
38-
* @dataProvider libcProvider
39-
*/
40-
public function testIsStatic(string $libc, bool $expected): void
41-
{
42-
putenv("SPC_LIBC={$libc}");
43-
44-
$result = SPCTarget::isStatic();
45-
$this->assertEquals($expected, $result);
46-
}
47-
4837
/**
4938
* @dataProvider libcProvider
5039
*/

0 commit comments

Comments
 (0)