-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing up trait to get rid of static references
- Loading branch information
Blaize Kaye
committed
Jul 2, 2024
1 parent
36ae161
commit 44e7e58
Showing
8 changed files
with
82 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Step; | ||
|
||
use Migrator\Step\DynamicEnvironment; | ||
use PHPUnit\Framework\TestCase; | ||
class DynamicEnvironmentTest extends TestCase | ||
{ | ||
|
||
/** | ||
* @return DynamicEnvironmentTraitTestClass | ||
*/ | ||
public function getAndSetupDynamicEnv() { | ||
$class = new DynamicEnvironment(); | ||
return $class; | ||
} | ||
|
||
public function testGetVariable() | ||
{ | ||
$testClass = $this->getAndSetupDynamicEnv(); | ||
$testClass->setVariable("testval", 555); | ||
$this->assertEquals(555, $testClass->getVariable("testval")); | ||
} | ||
|
||
public function testPassingByValue() | ||
{ | ||
$innerfunc = function(DynamicEnvironment $de) { | ||
$de->setVariable("setbyinner", true); | ||
}; | ||
|
||
$dynamicEnv = new DynamicEnvironment(); | ||
$innerfunc($dynamicEnv); | ||
$this->assertTrue($dynamicEnv->getVariable("setbyinner")); | ||
} | ||
} |