Skip to content

Instantly share code, notes, and snippets.

@fabriziomachado
Created September 6, 2011 18:11
Show Gist options
  • Save fabriziomachado/1198474 to your computer and use it in GitHub Desktop.
Save fabriziomachado/1198474 to your computer and use it in GitHub Desktop.
tests/models/PersonTest.php
<?php
include_once dirname(__FILE__) . '/../support/enviromment.php';
/**
* @group models
*/
class PersonTest extends CIUnit_TestCase {
public function setUp() {
$this->CI->load->spark('php-activerecord/0.0.1');
parent::setUp();
}
public function tearDown() {
parent::tearDown();
}
public function testShouldImplementSingleTableInheritance() {
$person = new Person();
$studend = new Student();
$teacher = new Teacher();
$expected = array($person->type, $studend->type, $teacher->type);
$actual = array(NULL,'Student', 'Teacher');
$this->assertEquals($expected, $actual);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment