File: RdoTest.php

package info (click to toggle)
php-horde-sesha 1.0.0~rc3-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 960 kB
  • sloc: php: 1,887; xml: 386; makefile: 18; sh: 3
file content (44 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Test the Rdo backend driver.
 *
 * PHP version 5
 *
 * @category   Horde
 * @package    Sesha
 * @subpackage UnitTests
 * @author     Ralf Lang <lang@b1-systems.de>
 * @link       http://www.horde.org/apps/sesha
 */
class Sesha_Unit_Driver_RdoTest extends Sesha_TestCase
{

    protected function setUp(): void
    {
        self::$db->delete("DELETE FROM sesha_categories");
        $categoryAddSql = 'INSERT INTO sesha_categories' .
               ' (category, description, priority)' .
               ' VALUES ("books", "Book inventory", "3")';

        self::$db->insert($categoryAddSql);
    }

    public function testSetup()
    {
        $driver = self::$driver;
        $this->assertInstanceOf('Sesha_Driver', $driver);
    }

    public function testCategoryExists() {
        $this->assertTrue(self::$driver->categoryExists('books'));
    }

    public function testAddCategory() {
        $category = array( 'category' => 'fish',
            'description' => 'Frutti di mare',
            'priority' => '2'
        );
        $this->assertInstanceOf('Sesha_Entity_Category',self::$driver->addCategory($category));
    }

}