Overview

Namespaces

  • Avisota
    • Event
    • Message
    • Queue
    • Recipient
    • RecipientSource
    • Renderer
    • Templating
    • Test
      • Database
      • Imap
      • Message
      • Queue
      • Renderer
      • Transport
    • Transport

Classes

  • AbstractQueueTest
  • AbstractSimpleDatabaseQueueTest
  • SqliteSmtpTransportSimpleDatabaseQueueTest
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: 
 3: /**
 4:  * Avisota newsletter and mailing system
 5:  *
 6:  * PHP Version 5.3
 7:  *
 8:  * @copyright  bit3 UG 2013
 9:  * @author     Tristan Lins <tristan.lins@bit3.de>
10:  * @package    avisota-core
11:  * @license    LGPL-3.0+
12:  * @link       http://avisota.org
13:  */
14: 
15: namespace Avisota\Test;
16: 
17: use Avisota\Queue\SimpleDatabaseQueue;
18: use Doctrine\DBAL\Configuration;
19: use Doctrine\DBAL\DriverManager;
20: use Doctrine\DBAL\Schema\Column;
21: use Doctrine\DBAL\Statement;
22: 
23: abstract class AbstractSimpleDatabaseQueueTest extends AbstractQueueTest
24: {
25:     /**
26:      * @var DoctrineConnectionProviderInterface
27:      */
28:     protected $doctrineConnectionProvider;
29: 
30:     protected function createQueue()
31:     {
32:         $connection = $this->doctrineConnectionProvider->createDoctrineConnection();
33:         return new SimpleDatabaseQueue($connection, 'queue', true);
34:     }
35: 
36:     /**
37:      * @expectedException RuntimeException
38:      */
39:     public function testCreateTableException()
40:     {
41:         $connection = $this->doctrineConnectionProvider->createDoctrineConnection();
42:         new SimpleDatabaseQueue($connection, 'queue', false);
43:     }
44: 
45:     public function testCreateTable()
46:     {
47:         $connection = $this->doctrineConnectionProvider->createDoctrineConnection();
48:         new SimpleDatabaseQueue($connection, 'queue', true);
49: 
50:         $schemaManager = $connection->getSchemaManager();
51: 
52:         $this->assertEquals(
53:             array('queue'),
54:             $schemaManager->listTableNames()
55:         );
56: 
57:         $this->assertEquals(
58:             array('id', 'enqueue', 'message', 'delivery_date'),
59:             array_keys($schemaManager->listTableColumns('queue'))
60:         );
61:     }
62: }
63: 
avisota/core API documentation generated by ApiGen 2.8.0