silverstripe-dms/tests/DMSTagTest.php

24 lines
661 B
PHP
Raw Normal View History

2012-07-25 08:56:43 +02:00
<?php
class DMSTagTest extends SapphireTest {
//static $fixture_file = "dms/tests/dmstest.yml";
function testAddingTags() {
$doc = new DMSDocument();
$doc->Filename = "test file";
$doc->Folder = "0";
$doc->write();
$doc->addTag("fruit","banana");
$doc->addTag("fruit","orange");
$doc->addTag("fruit","apple");
$doc->addTag("company","apple");
$doc->addTag("company","SilverStripe");
$fruits = $doc->getTags("fruit");
$this->assertNotNull($fruits,"Something returned for fruit tags");
$this->assertEquals(count($fruits),3,"3 fruit tags returned");
2012-07-25 08:59:01 +02:00
$this->assertTrue(in_array("banana",$fruits),"correct fruit tags returned");
2012-07-25 08:56:43 +02:00
}
}