--- /dev/null
+<?php
+
+class PdoChannelVersionManagerTest extends AlloServeurTest {
+
+ /** @var PdoChannelVersionManager */
+ private $pdoChannelManager;
+
+ protected function setUp(){
+ parent::setUp();
+ $this->pdoChannelManager = new PdoChannelVersionManager();
+ }
+
+ public function testCreate(){
+ $channel = new ChannelVersion();
+ $channel->channel_id = 1;
+ $channel->status = ChannelVersion::STATUS_MAJ_OK;
+ $channel->version_id = 1;
+ $channel_id = $this->pdoChannelManager->edit($channel);
+ $channel = $this->pdoChannelManager->getChannel($channel_id);
+ $this->assertEquals(1,$channel->channel_id);
+ }
+
+ public function testUpdate(){
+ $channel = $this->pdoChannelManager->getChannel(1);
+ $channel->status = ChannelVersion::STATUS_MAK_KO;
+ $this->pdoChannelManager->edit($channel);
+ $channel = $this->pdoChannelManager->getChannel(1);
+ $this->assertEquals(ChannelVersion::STATUS_MAK_KO,$channel->status);
+ }
+
+ public function testListByVersion(){
+ $list = $this->pdoChannelManager->listByVersion(1);
+ $this->assertEquals(1,$list[0]['id']);
+ }
+
+ public function testDelete(){
+ $this->pdoChannelManager->delete(1);
+ $this->assertEmpty($this->pdoChannelManager->listByVersion(1));
+ }
+
+}
\ No newline at end of file