Last active
August 29, 2015 14:03
-
-
Save jakeasmith/51e6c464957f2f8d5a67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class BaseType | |
{ | |
abstract public function calculate($foo, $bar); | |
public function validate($baz) | |
{ | |
return $baz === true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SpecialType extends BaseType | |
{ | |
public function calculate($foo, $bar) { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What’s the general recommendation on testing methods in an abstract class?
Option 1: Extend BaseType just for testing. Seems weird.
Option 2: Test BaseType as part of the SpecialType test case. Seems fragile.
Option 3: Erm. Something else?