Skip to content

Commit c86ace0

Browse files
committed
reorganized *HttpExceptionTest classes to prevent code duplication
1 parent c38c17b commit c86ace0

15 files changed

+33
-298
lines changed

src/Symfony/Component/HttpKernel/Tests/Exception/AccessdeniedHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the AccessDeniedHttpException class.
99
*/
10-
class AccessDeniedHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class AccessDeniedHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/BadRequestHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the BadRequestHttpException class.
99
*/
10-
class BadRequestHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class BadRequestHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/ConflictHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the ConflictHttpException class.
99
*/
10-
class ConflictHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class ConflictHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/GoneHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the GoneHttpException class.
99
*/
10-
class GoneHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class GoneHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/LengthRequiredHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the LengthRequiredHttpException class.
99
*/
10-
class LengthRequiredHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class LengthRequiredHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/MethodNotAllowedHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the MethodNotAllowedHttpException class.
99
*/
10-
class MethodNotAllowedHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class MethodNotAllowedHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is set as expected.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/NotAcceptableHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the NotAcceptableHttpException class.
99
*/
10-
class NotAcceptableHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class NotAcceptableHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/NotFoundHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the NotFoundHttpException class.
99
*/
10-
class NotFoundHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class NotFoundHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/PreconditionFailedHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the PreconditionFailedHttpException class.
99
*/
10-
class PreconditionFailedHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class PreconditionFailedHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

src/Symfony/Component/HttpKernel/Tests/Exception/PreconditionRequiredHttpExceptionTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,8 @@
77
/**
88
* Test the PreconditionRequiredHttpException class.
99
*/
10-
class PreconditionRequiredHttpExceptionTest extends \PHPUnit_Framework_TestCase
10+
class PreconditionRequiredHttpExceptionTest extends HttpExceptionTest
1111
{
12-
/**
13-
* Provides header data for the tests.
14-
*
15-
* @return array
16-
*/
17-
public function headerDataProvider()
18-
{
19-
return array(
20-
array(array('X-Test' => 'Test')),
21-
array(array('X-Test' => 1)),
22-
array(
23-
array(
24-
array('X-Test' => 'Test'),
25-
array('X-Test-2' => 'Test-2'),
26-
),
27-
),
28-
);
29-
}
30-
3112
/**
3213
* Test that the default headers is an empty array.
3314
*/

0 commit comments

Comments
 (0)