Zend2Test   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A testZend2() 0 25 3
1
<?php
2
3
namespace Aimeos\Perf\Config;
4
5
6
/**
7
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
8
 * @copyright Aimeos (aimeos.org), 2014-2018
9
 */
10
class Zend2Test extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
{
12
	public function testZend2()
13
	{
14
		if( class_exists( 'Zend\Config' ) === false ) {
15
			$this->markTestSkipped( 'Class Zend\Config not found' );
16
		}
17
18
19
		$start = microtime( true );
20
21
		$paths = array(
22
			dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'one',
23
			dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'two',
24
		);
25
26
		for( $i = 0; $i < 1000; $i++ )
27
		{
28
			$conf = new \Aimeos\MW\Config\Zend( new Zend\Config\Config( [], true ), $paths );
0 ignored issues
show
Bug introduced by
The type Aimeos\Perf\Config\Zend\Config\Config was not found. Did you mean Zend\Config\Config? If so, make sure to prefix the type with \.
Loading history...
29
30
			$conf->get( 'test/db/host' );
31
			$conf->get( 'test/db/username' );
32
			$conf->get( 'test/db/password' );
33
		}
34
35
		$stop = microtime( true );
36
		echo "\n    config zend2: " . ( ( $stop - $start ) * 1000 ) . " msec\n";
37
	}
38
}
39