-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Hametuha\Sharee\Tests; | ||
|
||
use Hametuha\Sharee\Models\RevenueMetaModel; | ||
use Hametuha\Sharee\Models\RevenueModel; | ||
|
||
/** | ||
* Utility class for UnitTest | ||
* | ||
* @package sharee | ||
* @property-read RevenueMetaModel $revenue_meta Revenue meta model. | ||
* @property-read RevenueModel $revenue Revenue model. | ||
*/ | ||
abstract class UnitTestCase extends \WP_UnitTestCase { | ||
|
||
/** | ||
* Getter | ||
* | ||
* @param string $name | ||
* | ||
* @return mixed | ||
*/ | ||
public function __get( $name ) { | ||
switch ( $name ) { | ||
case 'revenue': | ||
return RevenueModel::get_instance(); | ||
case 'revenue_meta': | ||
return RevenueMetaModel::get_instance(); | ||
default: | ||
return parent::__get( $name ); | ||
} | ||
} | ||
} |
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
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