TagadelicTagTest.php in Tagadelic 8.3
File
tests/src/Unit/TagadelicTagTest.php
View source
<?php
namespace Drupal\Tests\tagadelic\Unit;
use Drupal\Tests\UnitTestCase;
class TagadelicTagTest extends UnitTestCase {
protected $object;
public function setUp() {
parent::setUp();
$this->object = new \Drupal\tagadelic\TagadelicTag(42, "blackbeard", 2);
$this->object
->setDescription('Testing description');
}
public function testGetName() {
$this
->assertEquals("blackbeard", $this->object
->getName());
}
public function testGetCount() {
$this
->assertEquals(2, $this->object
->getCount());
}
public function testGetId() {
$this
->assertEquals(42, $this->object
->getId());
}
public function testGetDescription() {
$this
->assertEquals('Testing description', $this->object
->getDescription());
}
public function testGetWeight() {
$this
->assertEquals(0.0, $this->object
->getWeight());
$this->object
->setWeight(1.0);
$this
->assertEquals(1.0, $this->object
->getWeight());
}
public function testDistributed() {
$this
->assertEquals(log(2), $this->object
->distributed());
}
}