Skip to content

Commit 017bac9

Browse files
committed
[QS] Added basic instance unit tests for blocks
1 parent eb7a6b6 commit 017bac9

5 files changed

Lines changed: 281 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
22+
/**
23+
* Class FireGento_AdminMonitoring_Test_Block_Adminhtml_History
24+
*/
25+
class FireGento_AdminMonitoring_Test_Block_Adminhtml_History extends EcomDev_PHPUnit_Test_Case
26+
{
27+
/**
28+
* @var FireGento_AdminMonitoring_Block_Adminhtml_History
29+
*/
30+
protected $_block;
31+
32+
/**
33+
* Set up test class
34+
*/
35+
protected function setUp()
36+
{
37+
parent::setUp();
38+
$this->_block = self::app()->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history');
39+
}
40+
41+
/**
42+
* Test model instance
43+
*/
44+
public function testInstance()
45+
{
46+
$this->assertInstanceOf(
47+
'FireGento_AdminMonitoring_Block_Adminhtml_History',
48+
$this->_block
49+
);
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
22+
/**
23+
* Class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_Grid
24+
*/
25+
class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_Grid extends EcomDev_PHPUnit_Test_Case
26+
{
27+
/**
28+
* @var FireGento_AdminMonitoring_Block_Adminhtml_History_Grid
29+
*/
30+
protected $_block;
31+
32+
/**
33+
* Set up test class
34+
*/
35+
protected function setUp()
36+
{
37+
parent::setUp();
38+
$this->_block = self::app()->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history_grid');
39+
}
40+
41+
/**
42+
* Test model instance
43+
*/
44+
public function testInstance()
45+
{
46+
$this->assertInstanceOf(
47+
'FireGento_AdminMonitoring_Block_Adminhtml_History_Grid',
48+
$this->_block
49+
);
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
22+
/**
23+
* Class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_Grid_Link
24+
*/
25+
class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_Grid_Link extends EcomDev_PHPUnit_Test_Case
26+
{
27+
/**
28+
* @var FireGento_AdminMonitoring_Block_Adminhtml_History_Grid_Link
29+
*/
30+
protected $_block;
31+
32+
/**
33+
* Set up test class
34+
*/
35+
protected function setUp()
36+
{
37+
parent::setUp();
38+
$this->_block = self::app()->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history_grid_link');
39+
}
40+
41+
/**
42+
* Test model instance
43+
*/
44+
public function testInstance()
45+
{
46+
$this->assertInstanceOf(
47+
'FireGento_AdminMonitoring_Block_Adminhtml_History_Grid_Link',
48+
$this->_block
49+
);
50+
}
51+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
22+
/**
23+
* Class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_View
24+
*/
25+
class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_View extends EcomDev_PHPUnit_Test_Case_Controller
26+
{
27+
/**
28+
* @var FireGento_AdminMonitoring_Block_Adminhtml_History_View
29+
*/
30+
protected $_block;
31+
32+
/**
33+
* Set up test class
34+
*/
35+
protected function setUp()
36+
{
37+
parent::setUp();
38+
39+
/* @var $history FireGento_AdminMonitoring_Model_History */
40+
$history = Mage::getModel('firegento_adminmonitoring/history');
41+
Mage::register('current_history', $history, true);
42+
43+
$this->_block = self::app()->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history_view');
44+
}
45+
46+
/**
47+
* Tear down test class
48+
*/
49+
protected function tearDown()
50+
{
51+
Mage::unregister('current_history');
52+
}
53+
54+
/**
55+
* Test model instance
56+
*/
57+
public function testInstance()
58+
{
59+
$this->assertInstanceOf(
60+
'FireGento_AdminMonitoring_Block_Adminhtml_History_View',
61+
$this->_block
62+
);
63+
}
64+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
22+
/**
23+
* Class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_View_Detail
24+
*/
25+
class FireGento_AdminMonitoring_Test_Block_Adminhtml_History_View_Detail extends EcomDev_PHPUnit_Test_Case_Controller
26+
{
27+
/**
28+
* @var FireGento_AdminMonitoring_Block_Adminhtml_History_View_Detail
29+
*/
30+
protected $_block;
31+
32+
/**
33+
* Set up test class
34+
*/
35+
protected function setUp()
36+
{
37+
parent::setUp();
38+
39+
/* @var $history FireGento_AdminMonitoring_Model_History */
40+
$history = Mage::getModel('firegento_adminmonitoring/history');
41+
Mage::register('current_history', $history, true);
42+
43+
$this->_block = self::app()->getLayout()->createBlock('firegento_adminmonitoring/adminhtml_history_view_detail');
44+
}
45+
46+
/**
47+
* Tear down test class
48+
*/
49+
protected function tearDown()
50+
{
51+
Mage::unregister('current_history');
52+
}
53+
54+
/**
55+
* Test model instance
56+
*/
57+
public function testInstance()
58+
{
59+
$this->assertInstanceOf(
60+
'FireGento_AdminMonitoring_Block_Adminhtml_History_View_Detail',
61+
$this->_block
62+
);
63+
}
64+
}

0 commit comments

Comments
 (0)