GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 57ebb4...86d5a0 )
by Danger
02:58
created

testDeletePostWorkspaceCheck()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
namespace Tests;
4
5
use Silex\WebTestCase;
6
use JsonSchema\Validator;
7
8
class WorkspaceCheckinTest extends PartTest
9
{
10
    use AbstractAppTest;
11
12
13
    public function testPostWorkspaceCheck(){
14
        $blob = $this->testPostWorkspacePart();
15
        $id = $blob[0];
16
        $part_id= $blob[1];
17
18
        print_r("FANFARA!");
19
        var_dump($blob);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($blob); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
20
        $client = $this->createClient();
21
        $client = $this->logIn2($client);
22
        $client->request(
23
          'POST',
24
          '/api/v1/workspace/'.$id.'/part/'.$part_id.'/checkin',
25
          [],
26
          [],
27
          ['CONTENT_TYPE' => 'application/json'],
28
          '');
29
        $response = $client->getResponse();
0 ignored issues
show
Unused Code introduced by
$response 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...
30
        $data = $client->getResponse()->getContent();
31
        print_r("ROBAGROSSA");
32
        var_dump($data);
33
        $js = json_decode($data);
34
        $points = $js->points;
35
36
        $this->assertTrue(is_numeric($points));  //TODO verificare che il numero sia adeguato ai punti attesi
37
38
        return [$id,$part_id];
39
    }
40
41
    public function testDeletePostWorkspaceCheck(){
42
        $blob = $this->testPostWorkspaceCheck();
43
        $id = $blob[0];
44
        $part_id= $blob[1];
45
46
        print_r("FANFARA!");
47
        var_dump($blob);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($blob); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
48
        $client = $this->createClient();
49
        $client = $this->logIn2($client);
50
        $client->request(
51
          'DELETE',
52
          '/api/v1/workspace/'.$id.'/part/'.$part_id.'/checkin',
53
          [],
54
          [],
55
          ['CONTENT_TYPE' => 'application/json'],
56
          '');
57
        $response = $client->getResponse();
58
59
60
        $this->assertEquals(204,$response->getStatusCode());  //TODO verificare che il dato non sia più presente sul server
61
62
        return [$id,$part_id];
63
    }
64
}
65