Skip to content

Instantly share code, notes, and snippets.

@johannesnagl
Created December 4, 2013 11:18
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/7785994 to your computer and use it in GitHub Desktop.
Save johannesnagl/7785994 to your computer and use it in GitHub Desktop.
<?php
App::uses('Group', 'Model');
class GroupTest extends CakeTestCase {
public $fixtures = array('app.group', 'app.groupsUser', 'app.channelsClient', 'app.client');
public $autoFixtures = false;
public function setUp() {
parent::setUp();
$this->Group = ClassRegistry::init('Group');
}
public function testGetChannelCount() {
$this->loadFixtures('Group', 'ChannelsClient', 'Client');
$result = $this->Group->getChannelCount(1);
$this->assertEquals(1, $result);
$result = $this->Group->getChannelCount(2);
$this->assertEquals(0, $result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment