Last active
May 17, 2016 03:29
-
-
Save Zetzumarshen/5eb3f5d4d020181960f3359d4efe9741 to your computer and use it in GitHub Desktop.
This file contains 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
// Contoh mocking dengan membaca global variable. | |
// Buatlah fungsi private/protected untuk di mock di phpunit | |
class User | |
{ | |
public function getUsername(){ | |
return $this->getPost(); | |
} | |
protected function getPost(){ | |
return $username = $_POST['username']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment