Skip to content

Commit

Permalink
Add exception tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames committed Feb 18, 2017
1 parent 874a777 commit cf2f4dd
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Onoi\CallbackContainer\Tests\Exception;

use Onoi\CallbackContainer\Exception\ServiceAliasAssignmentException;

/**
* @covers \Onoi\CallbackContainer\Exception\ServiceAliasAssignmentException
* @group onoi-callback-container
*
* @license GNU GPL v2+
* @since 2.0
*
* @author mwjames
*/
class ServiceAliasAssignmentExceptionTest extends \PHPUnit_Framework_TestCase {

public function testCanConstruct() {

$this->assertInstanceOf(
'\Onoi\CallbackContainer\Exception\ServiceAliasAssignmentException',
new ServiceAliasAssignmentException( 'foo' )
);

$this->assertInstanceOf(
'\RuntimeException',
new ServiceAliasAssignmentException( 'foo' )
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Onoi\CallbackContainer\Tests\Exception;

use Onoi\CallbackContainer\Exception\ServiceAliasCrossAssignmentException;

/**
* @covers \Onoi\CallbackContainer\Exception\ServiceAliasCrossAssignmentException
* @group onoi-callback-container
*
* @license GNU GPL v2+
* @since 2.0
*
* @author mwjames
*/
class ServiceAliasCrossAssignmentExceptionTest extends \PHPUnit_Framework_TestCase {

public function testCanConstruct() {

$this->assertInstanceOf(
'\Onoi\CallbackContainer\Exception\ServiceAliasCrossAssignmentException',
new ServiceAliasCrossAssignmentException( 'foo', 'Bar', 'Foobar' )
);

$this->assertInstanceOf(
'\RuntimeException',
new ServiceAliasCrossAssignmentException( 'foo', 'Bar', 'Foobar' )
);
}

}
31 changes: 31 additions & 0 deletions tests/phpunit/Unit/Exception/ServiceAliasMismatchExceptionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Onoi\CallbackContainer\Tests\Exception;

use Onoi\CallbackContainer\Exception\ServiceAliasMismatchException;

/**
* @covers \Onoi\CallbackContainer\Exception\ServiceAliasMismatchException
* @group onoi-callback-container
*
* @license GNU GPL v2+
* @since 2.0
*
* @author mwjames
*/
class ServiceAliasMismatchExceptionTest extends \PHPUnit_Framework_TestCase {

public function testCanConstruct() {

$this->assertInstanceOf(
'\Onoi\CallbackContainer\Exception\ServiceAliasMismatchException',
new ServiceAliasMismatchException( 'foo' )
);

$this->assertInstanceOf(
'\RuntimeException',
new ServiceAliasMismatchException( 'foo' )
);
}

}

0 comments on commit cf2f4dd

Please sign in to comment.