Skip to content

Commit 05dfa4e

Browse files
committed
Index is front end controller now
1 parent aa4a70c commit 05dfa4e

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

event/listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public function adjust_quickmod_tools($event)
295295
public function viewonline_ideas($event)
296296
{
297297
if (($event['on_page'][1] === 'viewtopic' && $event['row']['session_forum_id'] == $this->config['ideas_forum_id']) ||
298-
($event['on_page'][1] === 'app' && strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/ideas') === 0))
298+
($event['on_page'][1] === 'index' && strrpos($event['row']['session_page'], 'index.' . $this->php_ext . '/ideas') === 0))
299299
{
300300
$event['location'] = $this->language->lang('VIEWING_IDEAS');
301301
$event['location_url'] = $this->helper->route('phpbb_ideas_index_controller');

tests/event/listener_test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,26 +360,26 @@ public static function viewonline_data()
360360
'$location_url',
361361
'$location',
362362
),
363-
// test when on_page is app and session_page is NOT for ideas
363+
// test when on_page is index and session_page is NOT for ideas
364364
array(
365365
array(
366-
1 => 'app',
366+
1 => 'index',
367367
),
368368
array(
369-
'session_page' => 'app.' . $phpEx . '/foobar'
369+
'session_page' => 'index.' . $phpEx . '/foobar'
370370
),
371371
'$location_url',
372372
'$location',
373373
'$location_url',
374374
'$location',
375375
),
376-
// test when on_page is app and session_page is for ideas
376+
// test when on_page is index and session_page is for ideas
377377
array(
378378
array(
379-
1 => 'app',
379+
1 => 'index',
380380
),
381381
array(
382-
'session_page' => 'app.' . $phpEx . '/ideas'
382+
'session_page' => 'index.' . $phpEx . '/ideas'
383383
),
384384
'$location_url',
385385
'$location',

tests/functional/ideas_test.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ideas_test extends ideas_functional_base
2121
public function test_view_ideas()
2222
{
2323
// Access /ideas directly
24-
$crawler = self::request('GET', "app.php/ideas");
24+
$crawler = self::request('GET', "index.php/ideas");
2525
$this->assertContainsLang('IDEAS_TITLE', $crawler->filter('h2')->text());
2626

2727
// Test forum redirect to /ideas from /viewforum.php
@@ -40,7 +40,7 @@ public function test_new_idea()
4040
$idea = $this->create_idea('Test Idea #1', 'This is an idea posted by the test framework.');
4141

4242
// Visit the new idea page and verify data
43-
$crawler = self::request('GET', "app.php/idea/{$idea['idea_id']}?sid=$this->sid");
43+
$crawler = self::request('GET', "index.php/idea/{$idea['idea_id']}?sid=$this->sid");
4444
$this->assertContainsLang('IDEAS', $crawler->filter('#nav-breadcrumbs')->text());
4545
self::assertStringContainsString($idea['subject'], $crawler->filter('h2')->text());
4646
self::assertStringContainsString($idea['message'], $crawler->filter('.content')->text());
@@ -54,34 +54,34 @@ public function test_new_idea()
5454
public function test_view_ideas_lists()
5555
{
5656
// Test new ideas list
57-
$crawler = self::request('GET', "app.php/ideas/list?sid=$this->sid");
57+
$crawler = self::request('GET', "index.php/ideas/list?sid=$this->sid");
5858
$this->assertContainsLang('OPEN_IDEAS', $crawler->filter('h2')->text());
5959
$this->assertNotContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
6060

6161
// Test top ideas list
62-
$crawler = self::request('GET', "app.php/ideas/list/top?sid=$this->sid");
62+
$crawler = self::request('GET', "index.php/ideas/list/top?sid=$this->sid");
6363
$this->assertContainsLang('LIST_TOP', $crawler->filter('h2')->text());
6464
$this->assertNotContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
6565

6666
// Test all ideas list
67-
$crawler = self::request('GET', "app.php/ideas/list/date?status=-1&sid=$this->sid");
67+
$crawler = self::request('GET', "index.php/ideas/list/date?status=-1&sid=$this->sid");
6868
$this->assertContainsLang('ALL_IDEAS', $crawler->filter('h2')->text());
6969
$this->assertNotContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
7070

7171
// Test implemented ideas list (should be empty list)
72-
$crawler = self::request('GET', "app.php/ideas/list/date?status=3&sid=$this->sid");
72+
$crawler = self::request('GET', "index.php/ideas/list/date?status=3&sid=$this->sid");
7373
$this->assertContainsLang('LIST_IMPLEMENTED', $crawler->filter('h2')->text());
7474
$this->assertContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
7575

7676
// Test my ideas list is empty when logged out
77-
$crawler = self::request('GET', "app.php/ideas/list/egosearch?status=-1&sid=$this->sid");
77+
$crawler = self::request('GET', "index.php/ideas/list/egosearch?status=-1&sid=$this->sid");
7878
$this->assertNotContainsLang('LIST_EGOSEARCH', $crawler->filter('#nav-main')->text());
7979
$this->assertContainsLang('LIST_EGOSEARCH', $crawler->filter('h2')->text());
8080
$this->assertContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
8181

8282
// Test my ideas list works when logged in
8383
$this->login();
84-
$crawler = self::request('GET', "app.php/ideas/list/egosearch?status=-1&sid=$this->sid");
84+
$crawler = self::request('GET', "index.php/ideas/list/egosearch?status=-1&sid=$this->sid");
8585
$this->assertContainsLang('LIST_EGOSEARCH', $crawler->filter('#nav-main')->text());
8686
$this->assertContainsLang('LIST_EGOSEARCH', $crawler->filter('h2')->text());
8787
$this->assertNotContainsLang('NO_IDEAS_DISPLAY', $crawler->filter('.topiclist.forums')->text());
@@ -104,17 +104,17 @@ public function test_notification_options()
104104
public function test_idea_errors()
105105
{
106106
// Visit an idea that does not exist
107-
$this->error_check("app.php/idea/0?sid=$this->sid", 'IDEA_NOT_FOUND');
107+
$this->error_check("index.php/idea/0?sid=$this->sid", 'IDEA_NOT_FOUND');
108108

109109
// Try to post new idea when not logged in
110-
$this->error_check("app.php/ideas/post?sid=$this->sid", 'LOGGED_OUT');
110+
$this->error_check("index.php/ideas/post?sid=$this->sid", 'LOGGED_OUT');
111111

112112
// Verify ideas controllers are no longer accessible when Ideas is unavailable
113113
$this->disable_ideas();
114-
$this->error_check("app.php/ideas?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
115-
$this->error_check("app.php/idea/1?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
116-
$this->error_check("app.php/ideas/list?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
117-
$this->error_check("app.php/ideas/post?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
114+
$this->error_check("index.php/ideas?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
115+
$this->error_check("index.php/idea/1?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
116+
$this->error_check("index.php/ideas/list?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
117+
$this->error_check("index.php/ideas/post?sid=$this->sid", 'IDEAS_NOT_AVAILABLE');
118118

119119
// While ideas is disabled, let's check that notifications are no longer available too
120120
$this->login();
@@ -148,7 +148,7 @@ public function error_check($url, $expected, $code = 404)
148148
public function create_idea($subject, $message)
149149
{
150150
// Visit Ideas post controller
151-
$crawler = self::request('GET', "app.php/ideas/post?sid=$this->sid");
151+
$crawler = self::request('GET', "index.php/ideas/post?sid=$this->sid");
152152

153153
// Set the form field data
154154
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();

tests/functional/viewonline_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class viewonline_test extends ideas_functional_base
2121
public function test_viewonline_visit_ideas()
2222
{
2323
$this->login();
24-
$crawler = self::request('GET', "app.php/ideas?sid=$this->sid");
24+
$crawler = self::request('GET', "index.php/ideas?sid=$this->sid");
2525
$this->assertContainsLang('IDEAS_TITLE', $crawler->filter('h2')->text());
2626
}
2727

0 commit comments

Comments
 (0)