Fix for phpcs

This commit is contained in:
James Tancock 2015-02-04 15:31:50 +00:00
parent b8b6b67abd
commit e173c29d33
3 changed files with 69 additions and 64 deletions

View file

@ -43,8 +43,8 @@ class FlashComponent extends Component {
/** /**
* Constructor * Constructor
* *
* @param ComponentCollection $collection * @param ComponentCollection $collection The ComponentCollection object
* @param array $settings * @param array $settings Settings passed via controller
*/ */
public function __construct(ComponentCollection $collection, $settings = array()) { public function __construct(ComponentCollection $collection, $settings = array()) {
$this->_defaultConfig = Hash::merge($this->_defaultConfig, $settings); $this->_defaultConfig = Hash::merge($this->_defaultConfig, $settings);

View file

@ -22,17 +22,17 @@ App::uses('FlashComponent', 'Controller/Component');
App::uses('ComponentCollection', 'Controller'); App::uses('ComponentCollection', 'Controller');
/** /**
* FlashComponentTest class * FlashComponentTest class
* *
* @package Cake.Test.Case.Controller.Component * @package Cake.Test.Case.Controller.Component
*/ */
class FlashComponentTest extends CakeTestCase { class FlashComponentTest extends CakeTestCase {
/** /**
* setUp method * setUp method
* *
* @return void * @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$this->Components = new ComponentCollection(); $this->Components = new ComponentCollection();
@ -40,20 +40,20 @@ class FlashComponentTest extends CakeTestCase {
} }
/** /**
* tearDown method * tearDown method
* *
* @return void * @return void
*/ */
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
CakeSession::destroy(); CakeSession::destroy();
} }
/** /**
* testSet method * testSet method
* *
* @return void * @return void
*/ */
public function testSet() { public function testSet() {
$this->assertNull(CakeSession::read('Flash.flash')); $this->assertNull(CakeSession::read('Flash.flash'));
@ -102,10 +102,10 @@ class FlashComponentTest extends CakeTestCase {
} }
/** /**
* testSetWithException method * testSetWithException method
* *
* @return void * @return void
*/ */
public function testSetWithException() { public function testSetWithException() {
$this->assertNull(CakeSession::read('Flash.flash')); $this->assertNull(CakeSession::read('Flash.flash'));
@ -121,10 +121,10 @@ class FlashComponentTest extends CakeTestCase {
} }
/** /**
* testSetWithComponentConfiguration method * testSetWithComponentConfiguration method
* *
* @return void * @return void
*/ */
public function testSetWithComponentConfiguration() { public function testSetWithComponentConfiguration() {
$this->assertNull(CakeSession::read('Flash.flash')); $this->assertNull(CakeSession::read('Flash.flash'));
@ -141,10 +141,10 @@ class FlashComponentTest extends CakeTestCase {
} }
/** /**
* Test magic call method. * Test magic call method.
* *
* @return void * @return void
*/ */
public function testCall() { public function testCall() {
$this->assertNull(CakeSession::read('Flash.flash')); $this->assertNull(CakeSession::read('Flash.flash'));

View file

@ -23,23 +23,28 @@ App::uses('View', 'View');
App::uses('CakePlugin', 'Core'); App::uses('CakePlugin', 'Core');
/** /**
* FlashHelperTest class * FlashHelperTest class
* *
* @package Cake.Test.Case.View.Helper * @package Cake.Test.Case.View.Helper
*/ */
class FlashHelperTest extends CakeTestCase { class FlashHelperTest extends CakeTestCase {
/**
* setupBeforeClass method
*
* @return void
*/
public static function setupBeforeClass() { public static function setupBeforeClass() {
App::build(array( App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
)); ));
} }
/** /**
* setUp method * setUp method
* *
* @return void * @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$controller = null; $controller = null;
@ -76,22 +81,22 @@ class FlashHelperTest extends CakeTestCase {
)); ));
} }
/** /**
* tearDown method * tearDown method
* *
* @return void * @return void
*/ */
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
unset($this->View, $this->Flash); unset($this->View, $this->Flash);
CakeSession::destroy(); CakeSession::destroy();
} }
/** /**
* testFlash method * testFlash method
* *
* @return void * @return void
*/ */
public function testFlash() { public function testFlash() {
$result = $this->Flash->render(); $result = $this->Flash->render();
$expected = '<div class="message">This is a calling</div>'; $expected = '<div class="message">This is a calling</div>';
@ -109,21 +114,21 @@ class FlashHelperTest extends CakeTestCase {
$this->assertNull($this->Flash->render('non-existent')); $this->assertNull($this->Flash->render('non-existent'));
} }
/** /**
* testFlashThrowsException * testFlashThrowsException
* *
* @expectedException UnexpectedValueException * @expectedException UnexpectedValueException
*/ */
public function testFlashThrowsException() { public function testFlashThrowsException() {
CakeSession::write('Flash.foo', 'bar'); CakeSession::write('Flash.foo', 'bar');
$this->Flash->render('foo'); $this->Flash->render('foo');
} }
/** /**
* test setting the element from the attrs. * test setting the element from the attrs.
* *
* @return void * @return void
*/ */
public function testFlashElementInAttrs() { public function testFlashElementInAttrs() {
$result = $this->Flash->render('notification', array( $result = $this->Flash->render('notification', array(
'element' => 'flash_helper', 'element' => 'flash_helper',
@ -135,11 +140,11 @@ class FlashHelperTest extends CakeTestCase {
$this->assertContains($expected, $result); $this->assertContains($expected, $result);
} }
/** /**
* test using elements in plugins. * test using elements in plugins.
* *
* @return void * @return void
*/ */
public function testFlashWithPluginElement() { public function testFlashWithPluginElement() {
App::build(array( App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)