Skip to content

Instantly share code, notes, and snippets.

@johannesnagl
Created December 4, 2013 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johannesnagl/7785824 to your computer and use it in GitHub Desktop.
Save johannesnagl/7785824 to your computer and use it in GitHub Desktop.
Simple test for my presentation
<?php
App::uses('Controller', 'Controller');
App::uses('View', 'View');
App::uses('ArticleHelper', 'View/Helper');
class ArticleHelperTest extends CakeTestCase {
public function setUp() {
parent::setUp();
$Controller = new Controller();
$View = new View($Controller);
$this->Article = new ArticleHelper($View);
}
public function testGetCellClass() {
$result = $this->Article->getCellClass(strtotime('now'));
$this->assertEqual('calendar-day-today', $result);
$result = $this->Article->getCellClass(strtotime('tomorrow'));
$this->assertEqual('calendar-day-future', $result);
$result = $this->Article->getCellClass(strtotime('yesterday'));
$this->assertEqual('calendar-day-past', $result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment