/**
  * Return the CMS's HTML-editor toolbar
  */
 public function EditorToolbar()
 {
     return HTMLEditorField_Toolbar::create($this, "EditorToolbar");
 }
 public function viewfile_getRemoteFileByURL($fileUrl)
 {
     return parent::viewfile_getRemoteFileByURL($fileUrl);
 }
    public function testGetAnchors()
    {
        if (!class_exists('Page')) {
            $this->markTestSkipped();
        }
        $linkedPage = new Page();
        $linkedPage->Title = 'Dummy';
        $linkedPage->write();
        $html = <<<EOS
<div name="foo"></div>
<div name='bar'></div>
<div id="baz"></div>
[sitetree_link id="{$linkedPage->ID}"]
<div id='bam'></div>
<div id = "baz"></div>
<div id = ""></div>
<div id="some'id"></div>
<div id=bar></div>
EOS;
        $expected = array('foo', 'bar', 'baz', 'bam', "some&#039;id");
        $page = new Page();
        $page->Title = 'Test';
        $page->Content = $html;
        $page->write();
        $this->useDraftSite(true);
        $request = new SS_HTTPRequest('GET', '/', array('PageID' => $page->ID));
        $toolBar = new HTMLEditorField_Toolbar(new Controller(), 'test');
        $toolBar->setRequest($request);
        $results = json_decode($toolBar->getanchors(), true);
        $this->assertEquals($expected, $results);
    }