|
@@ 150-170 (lines=21) @@
|
| 147 |
|
/** |
| 148 |
|
* Test the changelogFile method. |
| 149 |
|
*/ |
| 150 |
|
public function testChangelogFile() { |
| 151 |
|
$this->resetConfigCache(); |
| 152 |
|
$out = new BufferedOutput(); |
| 153 |
|
Config::setOutput( $out ); |
| 154 |
|
$this->assertSame( getcwd() . DIRECTORY_SEPARATOR . 'CHANGELOG.md', Config::changelogFile() ); |
| 155 |
|
|
| 156 |
|
$this->resetConfigCache(); |
| 157 |
|
$this->writeComposerJson( array( 'changelog' => 'changes.txt' ) ); |
| 158 |
|
Config::setOutput( $out ); |
| 159 |
|
$this->assertSame( getcwd() . DIRECTORY_SEPARATOR . 'changes.txt', Config::changelogFile() ); |
| 160 |
|
|
| 161 |
|
$this->resetConfigCache(); |
| 162 |
|
$this->writeComposerJson( array( 'changelog' => '/tmp/changes.md' ) ); |
| 163 |
|
Config::setOutput( $out ); |
| 164 |
|
$this->assertSame( '/tmp/changes.md', Config::changelogFile() ); |
| 165 |
|
|
| 166 |
|
$this->resetConfigCache(); |
| 167 |
|
$this->writeComposerJson( array( 'changelog' => 'c:\\changes.md' ) ); |
| 168 |
|
Config::setOutput( $out ); |
| 169 |
|
$this->assertSame( 'c:\\changes.md', Config::changelogFile() ); |
| 170 |
|
} |
| 171 |
|
|
| 172 |
|
/** |
| 173 |
|
* Test the changesDir method. |
|
@@ 175-195 (lines=21) @@
|
| 172 |
|
/** |
| 173 |
|
* Test the changesDir method. |
| 174 |
|
*/ |
| 175 |
|
public function testChangesDir() { |
| 176 |
|
$this->resetConfigCache(); |
| 177 |
|
$out = new BufferedOutput(); |
| 178 |
|
Config::setOutput( $out ); |
| 179 |
|
$this->assertSame( getcwd() . DIRECTORY_SEPARATOR . 'changelog', Config::changesDir() ); |
| 180 |
|
|
| 181 |
|
$this->resetConfigCache(); |
| 182 |
|
$this->writeComposerJson( array( 'changes-dir' => 'changes' ) ); |
| 183 |
|
Config::setOutput( $out ); |
| 184 |
|
$this->assertSame( getcwd() . DIRECTORY_SEPARATOR . 'changes', Config::changesDir() ); |
| 185 |
|
|
| 186 |
|
$this->resetConfigCache(); |
| 187 |
|
$this->writeComposerJson( array( 'changes-dir' => '/tmp/changes' ) ); |
| 188 |
|
Config::setOutput( $out ); |
| 189 |
|
$this->assertSame( '/tmp/changes', Config::changesDir() ); |
| 190 |
|
|
| 191 |
|
$this->resetConfigCache(); |
| 192 |
|
$this->writeComposerJson( array( 'changes-dir' => 'c:\\changes' ) ); |
| 193 |
|
Config::setOutput( $out ); |
| 194 |
|
$this->assertSame( 'c:\\changes', Config::changesDir() ); |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
/** |
| 198 |
|
* Test the types method. |