PHP Classes

File: tests/CDataTests.php

Recommend this page to a friend!
  Classes of Vasily Blinkov  >  \Xmtk\Parser  >  tests/CDataTests.php  >  Download  
File: tests/CDataTests.php
Role: Unit test script
Content type: text/plain
Description: Class source
Class: \Xmtk\Parser
Restructure the XML parsing results conveniently
Author: By
Last change:
Date: 4 years ago
Size: 600 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

require_once
__DIR__.'/../vendor/autoload.php';

use
PHPUnit\Framework\TestCase;
use
Xmtk\CData;

/* Covers CData */
final class CDataTests extends TestCase {
    private
$coder;

    protected function
setUp() {
       
$this->coder = new CData;
    }
// setUp()

   
function testCDataEncoderCanBeCreated() {
       
$this->assertInstanceOf(CData::class, $this->coder);
    }
// CData encoder can be created
   
function testCanEncodeToCData() {
       
$str = '<b>Some markup</b>';
       
$this->assertEquals("<![CDATA[$str]]>",
           
$this->coder->encode($str));
    }
// can encode to CData
} // CDataTests
?>

For more information send a message to info at phpclasses dot org.