| @@ 17-35 (lines=19) @@ | ||
| 14 | */ |
|
| 15 | protected $object; |
|
| 16 | ||
| 17 | public function setUp() |
|
| 18 | { |
|
| 19 | // we are using the config adapter native PHP here, |
|
| 20 | // it's a class extending the abstract class |
|
| 21 | // abstract classes cannot be instantiated |
|
| 22 | $this->object = new Config(); |
|
| 23 | ||
| 24 | vfsStreamWrapper::register(); |
|
| 25 | $this->configFileURL = vfsStream::url('root/test.config.php'); |
|
| 26 | $this->file = vfsStream::newFile('test.config.php', 0777)->withContent($this->getConfigFileContent()); |
|
| 27 | ||
| 28 | $this->configFileURL2 = vfsStream::url('root/test2.config.php'); |
|
| 29 | $this->file2 = vfsStream::newFile('test2.config.php', 0777)->withContent(''); |
|
| 30 | ||
| 31 | $this->root = new vfsStreamDirectory('root'); |
|
| 32 | $this->root->addChild($this->file); |
|
| 33 | $this->root->addChild($this->file2); |
|
| 34 | vfsStreamWrapper::setRoot($this->root); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function tearDown() |
|
| 38 | { |
|
| @@ 17-33 (lines=17) @@ | ||
| 14 | */ |
|
| 15 | protected $object; |
|
| 16 | ||
| 17 | public function setUp() |
|
| 18 | { |
|
| 19 | $this->object = new INI(); |
|
| 20 | ||
| 21 | vfsStreamWrapper::register(); |
|
| 22 | ||
| 23 | $this->configFileURL = vfsStream::url('root/config.ini'); |
|
| 24 | $this->file = vfsStream::newFile('config.ini', 0777)->withContent($this->getConfigFileContent()); |
|
| 25 | ||
| 26 | $this->booleanConfigFileURL = vfsStream::url('root/booleans.ini'); |
|
| 27 | $this->fileB = vfsStream::newFile('booleans.ini', 0777)->withContent($this->getBooleanConfigFileContent()); |
|
| 28 | ||
| 29 | $this->root = new vfsStreamDirectory('root'); |
|
| 30 | $this->root->addChild($this->file); |
|
| 31 | $this->root->addChild($this->fileB); |
|
| 32 | vfsStreamWrapper::setRoot($this->root); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function tearDown() |
|
| 36 | { |
|
| @@ 17-32 (lines=16) @@ | ||
| 14 | */ |
|
| 15 | protected $object; |
|
| 16 | ||
| 17 | public function setUp() |
|
| 18 | { |
|
| 19 | $this->object = new PHP(); |
|
| 20 | ||
| 21 | vfsStreamWrapper::register(); |
|
| 22 | $this->configFileURL = vfsStream::url('root/config.php'); |
|
| 23 | $this->file = vfsStream::newFile('config.php', 0777)->withContent($this->getConfigFileContent()); |
|
| 24 | ||
| 25 | $this->configFileURL2 = vfsStream::url('root/config2.php'); |
|
| 26 | $this->file2 = vfsStream::newFile('config2.php', 0777)->withContent(''); |
|
| 27 | ||
| 28 | $this->root = new vfsStreamDirectory('root'); |
|
| 29 | $this->root->addChild($this->file); |
|
| 30 | $this->root->addChild($this->file2); |
|
| 31 | vfsStreamWrapper::setRoot($this->root); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function tearDown() |
|
| 35 | { |
|
| @@ 21-38 (lines=18) @@ | ||
| 18 | * Sets up the fixture, for example, opens a network connection. |
|
| 19 | * This method is called before a test is executed. |
|
| 20 | */ |
|
| 21 | public function setUp() |
|
| 22 | { |
|
| 23 | $this->object = new File(); |
|
| 24 | ||
| 25 | vfsStreamWrapper::register(); |
|
| 26 | # file 1 |
|
| 27 | $this->configFileURL1 = vfsStream::url('root/errorlog.txt'); |
|
| 28 | $this->file1 = vfsStream::newFile('errorlog.txt', 0777); |
|
| 29 | # file 2 |
|
| 30 | $this->configFileURL2 = vfsStream::url('root/errorlog-full.txt'); |
|
| 31 | $this->file2 = vfsStream::newFile('errorlog-full.txt', 0777)->withContent($this->getFileContent()); |
|
| 32 | $this->root = new vfsStreamDirectory('root'); |
|
| 33 | $this->root->addChild($this->file1); |
|
| 34 | $this->root->addChild($this->file2); |
|
| 35 | vfsStreamWrapper::setRoot($this->root); |
|
| 36 | ||
| 37 | $this->object->setErrorLogFilename($this->configFileURL1); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Tears down the fixture, for example, closes a network connection. |
|
| @@ 17-30 (lines=14) @@ | ||
| 14 | */ |
|
| 15 | protected $object; |
|
| 16 | ||
| 17 | public function setUp() |
|
| 18 | { |
|
| 19 | $this->object = new JSON(); |
|
| 20 | ||
| 21 | vfsStreamWrapper::register(); |
|
| 22 | $this->configFileURL = vfsStream::url('root/config.json'); |
|
| 23 | $this->invalidConfigFileURL = vfsStream::url('root/invalid-config.json'); |
|
| 24 | $this->file = vfsStream::newFile('config.json', 0777)->withContent($this->getConfigFileContent()); |
|
| 25 | $this->invalidFile = vfsStream::newFile('invalid-config.json', 0777)->withContent($this->getInvalidConfigFileContent()); |
|
| 26 | $this->root = new vfsStreamDirectory('root'); |
|
| 27 | $this->root->addChild($this->file); |
|
| 28 | $this->root->addChild($this->invalidFile); |
|
| 29 | vfsStreamWrapper::setRoot($this->root); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function tearDown() |
|
| 33 | { |
|