public function testAdminThemePath() { MockHttp::routeGroup('admin'); MockHttp::run(); $this->_viewConf = new Conf(); $this->_viewConf->configureThemePath(); $this->assertContains('/app/view/public/', $this->_viewConf->getThemePath()); }
private function getBreadcrumbs(string $routeName, string $className) { MockHttp::routeGroup($routeName); MockHttp::routeName($routeName); MockHttp::run(); $this->bc = new Breadcrumbs(); $this->bc->getBreadcrumbs(); $bc = \PHPUnit_Framework_Assert::readAttribute($this->bc, 'breadcrumbs'); $this->assertInstanceOf($className, $bc); }
public function setUp() { MockHttp::routeGroup('admin'); MockHttp::routeSet(['alias' => 'route']); MockHttp::run(); MockConf::run(); MockDoctrine::queryBuilderResult([null]); // Symulate no result $entity = $this->getMockBuilder('Entity\\Posts')->getMock(); $entity->method('getPublic'); $this->_queryController = new QueryController(get_class($entity)); }
public function testGetCategoryIdFromPostRoute() { MockHttp::routeGroup('post'); MockHttp::routeSet(['alias' => 'anyPost']); MockHttp::run(); $this->_categoryBc = new CategoryBreadcrumbs(); $stub = new class { public function getCategory() { return new class { public function getId() { return 1; } }; } }; MockDoctrine::queryBuilderResult([$stub]); $catId = MockTest::callMockMethod($this->_categoryBc, 'getCategoryId'); $this->assertEquals(1, $catId); }