mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
31 lines
804 B
PHP
31 lines
804 B
PHP
|
<?php
|
||
|
|
||
|
class BlogTreeTest extends SapphireTest {
|
||
|
static $fixture_file = 'blog/tests/BlogTreeTest.yml';
|
||
|
|
||
|
function testGetAllBlogEntries() {
|
||
|
$node = $this->objFromFixture('BlogTree', 'root');
|
||
|
$this->assertEquals($node->Entries()->Count(), 3);
|
||
|
|
||
|
$node = $this->objFromFixture('BlogTree', 'levela');
|
||
|
$this->assertEquals($node->Entries()->Count(), 2);
|
||
|
|
||
|
$node = $this->objFromFixture('BlogTree', 'levelaa');
|
||
|
$this->assertEquals($node->Entries()->Count(), 2);
|
||
|
|
||
|
$node = $this->objFromFixture('BlogTree', 'levelab');
|
||
|
$this->assertNull($node->Entries());
|
||
|
|
||
|
$node = $this->objFromFixture('BlogTree', 'levelb');
|
||
|
$this->assertEquals($node->Entries()->Count(), 1);
|
||
|
|
||
|
$node = $this->objFromFixture('BlogTree', 'levelba');
|
||
|
$this->assertEquals($node->Entries()->Count(), 1);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|