Skip to content
Permalink
Browse files

Fix failing more tests on windows.

* Windows doesn't support info log level.
* Windows needs assertTextEquals()
* Windows has different opinions on invalid dates.
  • Loading branch information...
markstory committed Jul 26, 2014
1 parent 2fffc88 commit 7b0179b80af1ae49c17be560727d58af24288b6b
@@ -113,7 +113,7 @@ public function testCommands() {
$output = $this->out->output;
$expected = "TestPlugin.example TestPluginTwo.example TestPluginTwo.welcome bake i18n orm_cache server test sample\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -126,7 +126,7 @@ public function testOptionsNoArguments() {
$output = $this->out->output;
$expected = "--help -h --verbose -v --quiet -q\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -139,7 +139,7 @@ public function testOptionsNonExistingCommand() {
$output = $this->out->output;
$expected = "--help -h --verbose -v --quiet -q\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -152,7 +152,7 @@ public function testOptions() {
$output = $this->out->output;
$expected = "--help -h --verbose -v --quiet -q --connection -c --theme -t\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -165,7 +165,7 @@ public function testSubCommandsCorePlugin() {
$output = $this->out->output;
$expected = "behavior cell component controller fixture helper model plugin project shell test view widget zerg\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -191,7 +191,7 @@ public function testSubCommandsPlugin() {
$output = $this->out->output;
$expected = "say_hello\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -230,7 +230,7 @@ public function testSubCommands() {
$output = $this->out->output;
$expected = "behavior cell component controller fixture helper model plugin project shell test view widget zerg\n";
$this->assertEquals($expected, $output);
$this->assertTextEquals($expected, $output);
}
/**
@@ -67,7 +67,7 @@ public function tearDown() {
public function testExecute() {
$this->Task->interactive = false;
$this->Task->params['paths'] = TEST_APP . 'TestApp/Template/Pages';
$this->Task->params['paths'] = TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['extract-core'] = 'no';
$this->Task->expects($this->never())->method('err');
@@ -315,12 +315,12 @@ public function testScopedLogging() {
$this->_resetLogConfig();
Log::config('shops', array(
'engine' => 'File',
'types' => array('info', 'notice', 'warning'),
'types' => array('info', 'debug', 'warning'),
'scopes' => array('transactions', 'orders'),
'file' => 'shops',
));
Log::write('info', 'info message', 'transactions');
Log::write('debug', 'debug message', 'transactions');
$this->assertFileNotExists(LOGS . 'error.log');
$this->assertFileExists(LOGS . 'shops.log');
$this->assertFileExists(LOGS . 'debug.log');
@@ -400,24 +400,24 @@ public function testScopedLoggingExclusive() {
Log::config('shops', array(
'engine' => 'File',
'types' => array('info', 'notice', 'warning'),
'types' => array('debug', 'notice', 'warning'),
'scopes' => array('transactions', 'orders'),
'file' => 'shops.log',
));
Log::config('eggs', array(
'engine' => 'File',
'types' => array('info', 'notice', 'warning'),
'types' => array('debug', 'notice', 'warning'),
'scopes' => array('eggs'),
'file' => 'eggs.log',
));
Log::write('info', 'transactions message', 'transactions');
Log::write('debug', 'transactions message', 'transactions');
$this->assertFileNotExists(LOGS . 'eggs.log');
$this->assertFileExists(LOGS . 'shops.log');
$this->_deleteLogs();
Log::write('info', 'eggs message', 'eggs');
Log::write('debug', 'eggs message', 'eggs');
$this->assertFileExists(LOGS . 'eggs.log');
$this->assertFileNotExists(LOGS . 'shops.log');
}
@@ -560,8 +560,6 @@ public function invalidDataProvider() {
[null],
[false],
[''],
['0000-00-00'],
['0000-00-00 00:00:00'],
];
}
@@ -577,6 +575,22 @@ public function testToStringInvalid($value) {
$this->assertNotEmpty((string)$time);
}
/**
* These invalid values are not invalid on windows :(
*
* @return void
*/
public function testToStringInvalidZeros() {
$this->skipIf(DS === '\\', 'All zeros are valid on windows.');
$time = new Time('0000-00-00');
$this->assertInternalType('string', (string)$time);
$this->assertNotEmpty((string)$time);
$time = new Time('0000-00-00 00:00:00');
$this->assertInternalType('string', (string)$time);
$this->assertNotEmpty((string)$time);
}
/**
* Tests diffForHumans
*

0 comments on commit 7b0179b

Please sign in to comment.
You can’t perform that action at this time.