TagadelicTagToStringTest.php in Tagadelic 7.2
File
tests/TagadelicTagToStringTest.php
View source
<?php
require_once "TagadelicTagTest.php";
class TagadelicTagToStringTest extends TagadelicTagTest {
protected function setUp() {
parent::setUp();
$this->drupal
->expects($this
->once())
->method('l')
->will($this
->returnValue("<a>blackbeard</a>"));
}
public function test__ToString() {
$this
->assertTag(array(
"tag" => "a",
"content" => "blackbeard",
), $this->object
->__ToString());
}
public function test__ToStringHasLink() {
$link = '/foo/bar';
$this->object
->set_link($link);
$this->drupal
->expects($this
->any())
->method('l')
->with($this
->anything(), $this
->equalto($link), $this
->anything());
$this->object
->__tostring();
}
public function test__ToStringHasTitle() {
$this->object
->set_description("Foo Bar");
$expected_attrs = array(
"title" => "Foo Bar",
);
$this->drupal
->expects($this
->any())
->method('l')
->with($this
->anything(), $this
->anything(), $this
->equalto(array(
"attributes" => $expected_attrs,
)))
->will($this
->returnvalue(""));
$this->object
->__tostring();
}
public function test__ToStringHasNoTitle() {
$this->object
->set_description("");
$this->drupal
->expects($this
->any())
->method('l')
->with($this
->anything(), $this
->anything(), $this
->equalto(array()))
->will($this
->returnvalue(""));
$this->object
->__tostring();
}
public function test__ToStringHasWeight() {
$this->object
->set_weight(3);
$expected_attrs = array(
"class" => array(
"level3",
),
);
$this->drupal
->expects($this
->any())
->method('l')
->with($this
->anything(), $this
->anything(), $this
->equalto(array(
"attributes" => $expected_attrs,
)))
->will($this
->returnvalue(""));
$this->object
->__tostring();
}
public function test__ToStringHasNoWeight() {
$this->object
->set_weight(0);
$this->drupal
->expects($this
->any())
->method('l')
->with($this
->anything(), $this
->anything(), $this
->equalto(array()))
->will($this
->returnvalue(""));
$this->object
->__tostring();
}
}