currenciesRundaily = new CurrenciesRundaily(); } public function testIsEnabled_enabledTomorrow() { global $setup; $setup['EventDatePartTypeFix'] = date("d.m.Y", strtotime("tomorrow")); $this->assertTrue($this->currenciesRundaily->isEnabled()); } public function testIsEnabled_disabledYesterday() { global $setup; $setup['EventDatePartTypeFix'] = date("d.m.Y", strtotime("yesterday")); $this->assertFalse($this->currenciesRundaily->isEnabled()); } public function testIsEnabled_disabledToday() { global $setup; $setup['EventDatePartTypeFix'] = date("d.m.Y"); $this->assertFalse($this->currenciesRundaily->isEnabled()); } public function testRun() { $data = array(); $data['id'] = 2; $data['iso_2'] = "BG"; $data['name'] = "Lev (New) (BG)"; $data['short'] = "BGN"; $this->getDB()->insert("currencies", $data, false); $currency = $this->getDB()->fetchRow("currencies", 2); $this->assertEquals("0.0000000000", $currency['rate']); $this->currenciesRundaily->run(); $currency = $this->getDB()->fetchRow("currencies", 2); $this->assertNotEquals("0.0000000000", $currency['rate']); $this->assertContains("Updated currency BG to", implode("\n", $this->currenciesRundaily->getMessages())); } } ?>