123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- use Luticate\Utils\Business\LuBusiness;
-
- /**
- * Created by PhpStorm.
- * User: robin
- * Date: 5/29/16
- * Time: 2:57 PM
- */
-
- class MyEntitiesBusiness extends LuBusiness {
-
- }
-
- class My2EntitiesBusiness extends LuBusiness {
- protected static $_resourceNameUnPluralize = false;
- }
-
- class My3EntitiesBusiness extends LuBusiness {
- protected static $_resourceName = "MyEntity";
- }
-
- class MyUsersBusiness extends LuBusiness {
- protected static $_resourceNameUnPluralize = false;
- }
-
- class MyBusinessDontRespectTheRules extends LuBusiness {
-
- }
-
- class My2BusinessDontRespectTheRules extends LuBusiness {
- protected static $_resourceNameUnPluralize = false;
- }
-
- class LuBusinessTest extends \PHPUnit_Framework_TestCase
- {
- public function testResourceNameMyEntities()
- {
- $this->assertSame("MyEntity", MyEntitiesBusiness::getResourceName());
- }
-
- public function testResourceNameMy2Entities()
- {
- $this->assertSame("My2Entities", My2EntitiesBusiness::getResourceName());
- }
-
- public function testResourceNameMy3Entities()
- {
- $this->assertSame("MyEntity", My3EntitiesBusiness::getResourceName());
- }
-
- public function testResourceNameMyUsersBusiness()
- {
- $this->assertSame("MyUsers", MyUsersBusiness::getResourceName());
- }
-
- public function testResourceNameMyBusinessDontRespectTheRules()
- {
- $this->assertSame("MyBusinessDontRespectTheRule", MyBusinessDontRespectTheRules::getResourceName());
- }
-
- public function testResourceNameMy2BusinessDontRespectTheRules()
- {
- $this->assertSame("My2BusinessDontRespectTheRules", My2BusinessDontRespectTheRules::getResourceName());
- }
- }
|