1. Go to this page and download the library: Download jsiefer/class-mocker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jsiefer / class-mocker example snippets
/**
* My awesome sample plugin
*/
class MyPlugin extends Example_Namespace_AbstractPlugin
{
/**
* Return full name
*
* @return string
*/
public function getName()
{
if (!$this->_isLoaded) {
throw new Exception("Not yet loaded");
}
$firstname = $this->getFirstname();
$lastname = $this->getLastname();
return $firstname . ' ' . $lastname;
}
}