Code Duplication    Length = 24-26 lines in 2 locations

tests/DoctrineORMDiagnosticsModuleTest/ModuleCollaboration/WebDiagnosticsCollaborationTest.php 2 locations

@@ 79-102 (lines=24) @@
76
        );
77
    }
78
    
79
    public function testDiagnosticsRouteWithMigrationsUpToDate()
80
    {
81
        $this->mergeConfigFile(__DIR__ . '/../../../config/migrations_schema.global.php.dist');
82
83
        $this->dispatchDiagnostics(200);
84
        
85
        $response = $this->getResponse();
86
        \PHPUnit_Framework_Assert::assertInstanceOf(ResponseInterface::class, $response);
87
        
88
        $encoded = $response->getContent();
89
        \PHPUnit_Framework_Assert::assertNotEmpty($encoded);
90
        
91
        $decoded = Json::decode($encoded);
92
        $encodedPretty = json_encode($decoded, JSON_PRETTY_PRINT);
93
        \PHPUnit_Framework_Assert::assertAttributeEquals(true, 'passed', $decoded, $encodedPretty);
94
        \PHPUnit_Framework_Assert::assertObjectHasAttribute('details', $decoded, $encodedPretty);
95
        $details = $decoded->details;
96
        
97
        \PHPUnit_Framework_Assert::assertObjectHasAttribute(
98
            'DoctrineORMDiagnosticsModule: Schema Migrations Up-To-Date',
99
            $details,
100
            $encodedPretty
101
        );
102
    }
103
    
104
    public function testDiagnosticsRouteWithOrmSchemaValidation()
105
    {
@@ 104-129 (lines=26) @@
101
        );
102
    }
103
    
104
    public function testDiagnosticsRouteWithOrmSchemaValidation()
105
    {
106
        $this->updateSchema();
107
108
        $this->mergeConfigFile(__DIR__ . '/../../../config/orm_schema.global.php.dist');
109
        
110
        $this->dispatchDiagnostics(200);
111
        
112
        $response = $this->getResponse();
113
        \PHPUnit_Framework_Assert::assertInstanceOf(ResponseInterface::class, $response);
114
        
115
        $encoded = $response->getContent();
116
        \PHPUnit_Framework_Assert::assertNotEmpty($encoded);
117
        
118
        $decoded = Json::decode($encoded);
119
        $encodedPretty = json_encode($decoded, JSON_PRETTY_PRINT);
120
        \PHPUnit_Framework_Assert::assertAttributeEquals(true, 'passed', $decoded, $encodedPretty);
121
        \PHPUnit_Framework_Assert::assertObjectHasAttribute('details', $decoded, $encodedPretty);
122
        $details = $decoded->details;
123
        
124
        \PHPUnit_Framework_Assert::assertObjectHasAttribute(
125
            'DoctrineORMDiagnosticsModule: ORM Schema Valid',
126
            $details,
127
            $encodedPretty
128
        );
129
    }
130
131
    /**
132
     * @return Request