Skip to content

Commit 8534107

Browse files
committed
Remove template mock file
1 parent c397601 commit 8534107

2 files changed

Lines changed: 10 additions & 104 deletions

File tree

tests/event/listener_test.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class event_listener_test extends \phpbb_test_case
1717
/** @var \phpbb\googleanalytics\event\listener */
1818
protected $listener;
1919

20+
protected $config;
21+
protected $template;
22+
protected $user;
23+
2024
/**
2125
* Setup test environment
2226
*/
@@ -32,7 +36,8 @@ public function setUp()
3236

3337
// Load/Mock classes required by the event listener class
3438
$this->config = new \phpbb\config\config(array('googleanalytics_id' => 'UA-000000-01'));
35-
$this->template = new \phpbb\googleanalytics\tests\mock\template();
39+
$this->template = $this->getMockBuilder('\phpbb\template\template')
40+
->getMock();
3641
$this->user = new \phpbb\user('\phpbb\datetime');
3742
}
3843

@@ -76,13 +81,13 @@ public function test_load_google_analytics()
7681
{
7782
$this->set_listener();
7883

84+
$this->template->expects($this->once())
85+
->method('assign_var')
86+
->with('GOOGLEANALYTICS_ID', $this->config['googleanalytics_id']);
87+
7988
$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
8089
$dispatcher->addListener('core.page_header', array($this->listener, 'load_google_analytics'));
8190
$dispatcher->dispatch('core.page_header');
82-
83-
$this->assertEquals(array(
84-
'GOOGLEANALYTICS_ID' => $this->config['googleanalytics_id'],
85-
), $this->template->get_template_vars());
8691
}
8792

8893
/**

tests/mock/template.php

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)