handlebars.php-helpers/tests/Text/HelpersTest.php

49 lines
1.4 KiB
PHP
Raw Normal View History

2014-12-15 12:38:49 +03:00
<?php
/*
* This file is part of Handlebars.php Helpers Set
*
* (c) Dmitriy Simushev <simushevds@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace JustBlackBird\HandlebarsHelpers\Tests\Text;
2014-12-15 12:38:49 +03:00
use JustBlackBird\HandlebarsHelpers\Text\Helpers;
2014-12-15 12:38:49 +03:00
/**
* Test class for Text Helpers Set.
2014-12-15 12:38:49 +03:00
*
* @author Dmitriy Simushev <simushevds@gmail.com>
*/
class HelpersTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests that all helpers in the set exist and have valid classes.
*
* @dataProvider helpersProvider
*/
public function testHelper($name, $class)
{
$helpers = new Helpers();
$this->assertTrue($helpers->has($name), sprintf('There is no "%s" helper', $name));
$this->assertInstanceOf($class, $helpers->{$name});
}
/**
* A data provider for testHelper method.
*/
public function helpersProvider()
{
return array(
array('lowercase', '\\JustBlackBird\\HandlebarsHelpers\\Text\\LowercaseHelper'),
array('uppercase', '\\JustBlackBird\\HandlebarsHelpers\\Text\\UppercaseHelper'),
array('repeat', '\\JustBlackBird\\HandlebarsHelpers\\Text\\RepeatHelper'),
array('replace', '\\JustBlackBird\\HandlebarsHelpers\\Text\\ReplaceHelper'),
array('truncate', '\\JustBlackBird\\HandlebarsHelpers\\Text\\TruncateHelper'),
2014-12-15 12:38:49 +03:00
);
}
}