Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User
- {
- public function commonFunctionality()
- {
- return 'Something';
- }
- public function modifiedFunctionality()
- {
- return 'One Thing';
- }
- }
- class SpecialUser extends User
- {
- public function specialFunctionality()
- {
- return 'Nothing';
- }
- public function modifiedFunctionality()
- {
- return 'Another Thing';
- }
- }
- class Test_User extends PHPUnit_Framework_TestCase
- {
- public function create()
- {
- return new User();
- }
- public function testCommonFunctionality()
- {
- $user = $this->create();
- $this->assertEquals('Something', $user->commonFunctionality);
- }
- public function testModifiedFunctionality()
- {
- $user = $this->create();
- $this->assertEquals('One Thing', $user->commonFunctionality);
- }
- }
- class Test_SpecialUser extends Test_User
- {
- public function create() {
- return new SpecialUser();
- }
- public function testSpecialFunctionality()
- {
- $user = $this->create();
- $this->assertEquals('Nothing', $user->commonFunctionality);
- }
- public function testModifiedFunctionality()
- {
- $user = $this->create();
- $this->assertEquals('Another Thing', $user->commonFunctionality);
- }
- }
Add Comment
Please, Sign In to add comment