/**
* Tests that the configuration object is able to write setting values
* back out to multiple files.
*
* @return void
* @depends testImplementsOffsetExists
* @depends testImplementsOffsetGet
* @depends testImplementsOffsetSet
*/
public function testWrite()
{
$file1 = $this->createTempFile();
$file2 = $this->createTempFile();
file_put_contents($file1, '<?php return array("foo" => "bar");');
file_put_contents($file2, '<?php return array("baz" => "bay");');
$this->config->read($file1);
$this->config->read($file2);
$this->config['foo'] = 'test1';
$this->config['baz'] = 'test2';
$returned = $this->config->write();
$this->assertSame($returned, $this->config, 'write() does not implement a fluent interface');
$this->config = new Phergie_Config();
$this->config->read($file1);
$this->config->read($file2);
$this->assertEquals('test1', $this->config['foo']);
$this->assertEquals('test2', $this->config['baz']);
}