public function test() { $channel = new ObjectModel\Channel(); $channel->SetType("test"); $channel->SetUpdatePeriod(5); $channel->SetParameters(array("feedUrl" => "http://something", "something" => "elshdjsh87d7f76&^&*^SHGGT^&")); Modules\DataContext\MySql_V1\DataContext::AddNewChannelProgessingJob($channel); Modules\DataContext\MySql_V1\DataContext::ActivateChannelProcessingJob($channel); $channel = Modules\DataContext\MySql_V1\DataContext::SelectNextDueChannelProcessingJob(time()); $this->assertEquals(true, isset($channel)); $channels = Modules\DataContext\MySql_V1\DataContext::ListAllChannelProcessingJobs(); $found = false; foreach ($channels as $c) { if ($c->GetId() == $channel->GetId()) { $found = true; } } $this->assertEquals(true, $found); Modules\DataContext\MySql_V1\DataContext::DeactivateChannelProcessingJob($channel); Modules\DataContext\MySql_V1\DataContext::RemoveChannelProcessingJob($channel); $channels = Modules\DataContext\MySql_V1\DataContext::ListAllChannelProcessingJobs(); $found = false; foreach ($channels as $c) { if ($c->GetId() == $channel->GetId()) { $found = true; } } $this->assertEquals(false, $found); }
public function testParseChannelsToJSON() { $channel = new ObjectModel\Channel(); $channel->SetType("Test"); $channel->SetUpdatePeriod(5); $channel->SetParameters(array("one_k" => "one_v", "two_k" => "two_v")); $json = $this->object->ParseChannelsToJSON(array($channel)); }