Skip to content

Commit

Permalink
Adding simple unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
acairns committed Mar 12, 2014
1 parent 8e3a417 commit c0fa63c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Htmldiff Tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
15 changes: 15 additions & 0 deletions tests/HtmldiffTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

use Gathercontent\Htmldiff\Htmldiff;

class HtmldiffTest extends PHPUnit_Framework_TestCase
{

public function testStringDiff()
{
$htmldiff = new Htmldiff;
$result = $htmldiff->compare("Test", "Testing", true);

$this->assertEquals("<del>Test</del><ins>Testing</ins>", $result);
}
}

0 comments on commit c0fa63c

Please sign in to comment.