Code Duplication    Length = 33-33 lines in 2 locations

risoluto/lib/vendor_test/Risoluto/DbTest/DbTest4GetAttribute.php 2 locations

@@ 102-134 (lines=33) @@
99
     *
100
     * getAttribute()のテスト(引数未指定時)
101
     */
102
    public function test_getAttribute_NoArgs()
103
    {
104
        $params = [
105
            "driver" => $GLOBALS[ 'DB_DRIVER' ],
106
            "user" => $GLOBALS[ 'DB_USER' ],
107
            "pass" => $GLOBALS[ 'DB_PASSWORD' ],
108
            "dbname" => $GLOBALS[ 'DB_DBNAME' ],
109
            "host" => $GLOBALS[ 'DB_HOST' ],
110
            "persistent" => false,
111
        ];
112
113
        $instance = new Db;
114
        $instance->connect( $params );
115
        $tmp_result = $instance->getAttribute();
116
117
        $this->assertArrayHasKey( 'AUTOCOMMIT', $tmp_result );
118
        $this->assertArrayHasKey( 'PREFETCH', $tmp_result );
119
        $this->assertArrayHasKey( 'TIMEOUT', $tmp_result );
120
        $this->assertArrayHasKey( 'ERRMODE', $tmp_result );
121
        $this->assertArrayHasKey( 'SERVER_VERSION', $tmp_result );
122
        $this->assertArrayHasKey( 'CLIENT_VERSION', $tmp_result );
123
        $this->assertArrayHasKey( 'SERVER_INFO', $tmp_result );
124
        $this->assertArrayHasKey( 'CONNECTION_STATUS', $tmp_result );
125
        $this->assertArrayHasKey( 'CASE', $tmp_result );
126
        $this->assertArrayHasKey( 'DRIVER_NAME', $tmp_result );
127
        $this->assertArrayHasKey( 'ORACLE_NULLS', $tmp_result );
128
        $this->assertArrayHasKey( 'PERSISTENT', $tmp_result );
129
        $this->assertArrayHasKey( 'STATEMENT_CLASS', $tmp_result );
130
        $this->assertArrayHasKey( 'DEFAULT_FETCH_MODE', $tmp_result );
131
132
        $instance->disConnect();
133
        unset( $instance );
134
    }
135
136
    /**
137
     * test_getAttribute_ALL()
@@ 141-173 (lines=33) @@
138
     *
139
     * getAttribute()のテスト(引数"ALL"指定時)
140
     */
141
    public function test_getAttribute_ALL()
142
    {
143
        $params = [
144
            "driver" => $GLOBALS[ 'DB_DRIVER' ],
145
            "user" => $GLOBALS[ 'DB_USER' ],
146
            "pass" => $GLOBALS[ 'DB_PASSWORD' ],
147
            "dbname" => $GLOBALS[ 'DB_DBNAME' ],
148
            "host" => $GLOBALS[ 'DB_HOST' ],
149
            "persistent" => false,
150
        ];
151
152
        $instance = new Db;
153
        $instance->connect( $params );
154
        $tmp_result = $instance->getAttribute( 'ALL' );
155
156
        $this->assertArrayHasKey( 'AUTOCOMMIT', $tmp_result );
157
        $this->assertArrayHasKey( 'PREFETCH', $tmp_result );
158
        $this->assertArrayHasKey( 'TIMEOUT', $tmp_result );
159
        $this->assertArrayHasKey( 'ERRMODE', $tmp_result );
160
        $this->assertArrayHasKey( 'SERVER_VERSION', $tmp_result );
161
        $this->assertArrayHasKey( 'CLIENT_VERSION', $tmp_result );
162
        $this->assertArrayHasKey( 'SERVER_INFO', $tmp_result );
163
        $this->assertArrayHasKey( 'CONNECTION_STATUS', $tmp_result );
164
        $this->assertArrayHasKey( 'CASE', $tmp_result );
165
        $this->assertArrayHasKey( 'DRIVER_NAME', $tmp_result );
166
        $this->assertArrayHasKey( 'ORACLE_NULLS', $tmp_result );
167
        $this->assertArrayHasKey( 'PERSISTENT', $tmp_result );
168
        $this->assertArrayHasKey( 'STATEMENT_CLASS', $tmp_result );
169
        $this->assertArrayHasKey( 'DEFAULT_FETCH_MODE', $tmp_result );
170
171
        $instance->disConnect();
172
        unset( $instance );
173
    }
174
175
    /**
176
     * test_getAttribute_AUTOCOMMIT()