configureForTesting() public method

public configureForTesting ( array $configsArray )
$configsArray array The new internal configurations
Beispiel #1
0
 public function testGetSecret()
 {
     $this->shmockAndDieselify('\\Bart\\Shell', function ($shell) {
         $shell->std_in_secret()->once()->return_value('078-05-1120');
     });
     $configs = new TestConfig();
     $configs->configureForTesting([]);
     $social = $configs->getSocialSecurityNumber();
     $this->assertEquals('078-05-1120', $social, 'social');
     // Should use cache and not call std_in_secret a second time
     $social = $configs->getSocialSecurityNumber();
     $this->assertEquals('078-05-1120', $social, 'social');
 }