Completed
Push — master ( 78e73b...e8e5da )
by Michael
16:28
created

SmokeTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testContainerServices() 0 11 3
A testFunctionalTests() 0 5 1
A explosionProvider() 0 6 1
1
<?php
2
namespace Tests\AppBundle\Controller;
3
4
class SmokeTest extends BootstrapTestSuite
5
{
6
	public function testContainerServices()
7
	{
8
		$client = static::createClient();
9
		foreach ($client->getContainer()->getServiceIds() as $serviceId)
10
		{
11
			try {
12
				//$service = $client->getContainer()->get($serviceId);
13
				//$this->assertNotNull($service);
14
			} catch (InactiveScopeException $e) {}
0 ignored issues
show
Unused Code introduced by
catch (\Tests\AppBundle\...eScopeException $e) { } does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
Bug introduced by
The class Tests\AppBundle\Controller\InactiveScopeException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
15
		}
16
	}
17
18
	/**
19
	 * @dataProvider explosionProvider
20
	 */
21
	public function testFunctionalTests($path, $status = 200)
22
	{
23
		$objs = $this->setupTest($path);
0 ignored issues
show
Unused Code introduced by
$objs is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
24
		$this->globalTests($status);
25
	}
26
27
	public function explosionProvider()
28
	{
29
		return array(
30
			array('/'),
31
		);
32
	}
33
}
34