/var/www/hkosl.com/demo_google/application/vendor/owasp/phprbac/PhpRbac/tests/src/RbacSetup.php


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
45
46
47
48
49
50
51
52
53
54
<?php
//namespace PhpRbac;

use PhpRbac\Rbac;

/**
 * @file
 * Unit Tests for PhpRbac PSR Wrapper
 *
 * @defgroup phprbac_unit_test_wrapper_setup Unit Tests for Rbac Functionality
 * @ingroup phprbac_unit_tests
 * @{
 * Documentation for all Unit Tests regarding RbacSetup functionality.
 */

class RbacSetup extends \Generic_Tests_DatabaseTestCase
{
    
/*
     * Test Setup and Fixture
     */

    
public static $rbac;

    public static function 
setUpBeforeClass()
    {
        
self::$rbac = new Rbac('unit_test');

        if ((string) 
$GLOBALS['DB_ADAPTER'] === 'pdo_sqlite') {
            
self::$rbac->reset(true);
        }
    }

    protected function 
tearDown()
    {
        if ((string) 
$GLOBALS['DB_ADAPTER'] === 'pdo_sqlite') {
            
self::$rbac->reset(true);
        }
    }

    public function 
getDataSet()
    {
        return 
$this->createXMLDataSet(dirname(__FILE__) . '/datasets/database-seed.xml');
    }

    
/*
     * Tests for proper object instantiation
     */

    
public function testRbacInstance() {
        
$this->assertInstanceOf('PhpRbac\Rbac'self::$rbac);
    }
}

/** @} */ // End group phprbac_unit_test_wrapper_setup */