| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- /**
- * 描述.
- *
- * @author nj <nj@gmail.com>
- * @date 2020-01-22 22:53:13
- */
- declare(strict_types=1);
- namespace HyperfTest\Units;
- use App\Repositories\Utils\AccessControllerListsRepository;
- use HyperfTest\HttpTestCase;
- class AccessControllerListsRepositoryTest extends HttpTestCase
- {
- private $aclRepo = null;
- /**
- * 测试之前执行.
- */
- public function setUp(): void
- {
- parent::setUp();
- $this->aclRepo = make(AccessControllerListsRepository::class);
- }
- /**
- * 测试完毕后执行.
- */
- public function tearDown(): void
- {
- parent::tearDown();
- }
- public function testGetController()
- {
- $authConfig = config('manage_acl');
- $this->aclRepo->init($authConfig, 1);
- $this->aclRepo->getController(
- $authConfig,
- base_path() .'/Modules/Manage/Controllers',
- 'Controller',
- 'Modules\Manage\Controllers'
- );
- $result = $this->aclRepo->check('Controller');
- var_dump($result);
- $this->assertEquals(1, 1);
- }
- }
|