Code Duplication    Length = 37-41 lines in 11 locations

src/Bundle/GridBundle/Tests/Exception/LocaleNotFoundExceptionTest.php 1 location

@@ 20-56 (lines=37) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class LocaleNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var LocaleNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new LocaleNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('The locale could not be found.', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new LocaleNotFoundException($message = 'foo', $code = 123, $previous = new \Exception());
51
52
        $this->assertSame($message, $this->exception->getMessage());
53
        $this->assertSame($code, $this->exception->getCode());
54
        $this->assertSame($previous, $this->exception->getPrevious());
55
    }
56
}
57

src/Bundle/RegistryBundle/Tests/Exception/TagAttributeNotFoundExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class TagAttributeNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var TagAttributeNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new TagAttributeNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new TagAttributeNotFoundException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Bundle/ResourceBundle/Tests/Exception/RequestNotFoundExceptionTest.php 1 location

@@ 20-56 (lines=37) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class RequestNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var RequestNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new RequestNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('The request could not be found.', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new RequestNotFoundException($message = 'foo', $code = 123, $previous = new \Exception());
51
52
        $this->assertSame($message, $this->exception->getMessage());
53
        $this->assertSame($code, $this->exception->getCode());
54
        $this->assertSame($previous, $this->exception->getPrevious());
55
    }
56
}
57

src/Bundle/ResourceBundle/Tests/Exception/RuntimeExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class RuntimeExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var RuntimeException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new RuntimeException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new RuntimeException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Bundle/ResourceBundle/Tests/Exception/TagAttributeNotFoundExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class TagAttributeNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var TagAttributeNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new TagAttributeNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new TagAttributeNotFoundException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Grid/Tests/Exception/BadMethodCallExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class BadMethodCallExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var BadMethodCallException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new BadMethodCallException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\BadMethodCallException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new BadMethodCallException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Grid/Tests/Exception/ConfigNotFoundExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class ConfigNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var ConfigNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new ConfigNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new ConfigNotFoundException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Grid/Tests/Exception/InvalidArgumentExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class InvalidArgumentExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var InvalidArgumentException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new InvalidArgumentException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\InvalidArgumentException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new InvalidArgumentException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Locale/Tests/Exception/LocaleNotFoundExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class LocaleNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var LocaleNotFoundException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new LocaleNotFoundException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new LocaleNotFoundException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Registry/Tests/Exception/InvalidArgumentExceptionTest.php 1 location

@@ 20-60 (lines=41) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class InvalidArgumentExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var InvalidArgumentException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new InvalidArgumentException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\InvalidArgumentException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new InvalidArgumentException(
51
            $message = 'foo',
52
            $code = 123,
53
            $previous = new \Exception()
54
        );
55
56
        $this->assertSame($message, $this->exception->getMessage());
57
        $this->assertSame($code, $this->exception->getCode());
58
        $this->assertSame($previous, $this->exception->getPrevious());
59
    }
60
}
61

src/Component/Translation/Tests/Exception/RuntimeExceptionTest.php 1 location

@@ 20-56 (lines=37) @@
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class RuntimeExceptionTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var RuntimeException
24
     */
25
    private $exception;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function setUp()
31
    {
32
        $this->exception = new RuntimeException();
33
    }
34
35
    public function testInheritance()
36
    {
37
        $this->assertInstanceOf(\RuntimeException::class, $this->exception);
38
        $this->assertInstanceOf(ExceptionInterface::class, $this->exception);
39
    }
40
41
    public function testDefaultState()
42
    {
43
        $this->assertSame('', $this->exception->getMessage());
44
        $this->assertSame(0, $this->exception->getCode());
45
        $this->assertNull($this->exception->getPrevious());
46
    }
47
48
    public function testInitialState()
49
    {
50
        $this->exception = new RuntimeException($message = 'foo', $code = 123, $previous = new \Exception());
51
52
        $this->assertSame($message, $this->exception->getMessage());
53
        $this->assertSame($code, $this->exception->getCode());
54
        $this->assertSame($previous, $this->exception->getPrevious());
55
    }
56
}
57