PHPWord/Tests/PHPWord/Shared/FileTest.php
Roman Syroeshko 36c03d4f15 https://github.com/PHPOffice/PHPWord/issues/43
Redundant imports of PHPUnit_Framework_TestCase were removed.
2014-03-12 20:13:06 +04:00

42 lines
926 B
PHP

<?php
namespace PHPWord\Tests\Shared;
use PHPWord_Shared_File;
/**
* Class FileTest
*
* @package PHPWord\Tests
* @runTestsInSeparateProcesses
*/
class FileTest extends \PHPUnit_Framework_TestCase
{
/**
* Test file_exists()
*/
public function testFileExists()
{
$dir = join(
DIRECTORY_SEPARATOR,
array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates')
);
chdir($dir);
$this->assertTrue(PHPWord_Shared_File::file_exists('blank.docx'));
}
/**
* Test realpath()
*/
public function testRealpath()
{
$dir = join(
DIRECTORY_SEPARATOR,
array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates')
);
chdir($dir);
$file = 'blank.docx';
$expected = $dir . DIRECTORY_SEPARATOR . $file;
$this->assertEquals($expected, PHPWord_Shared_File::realpath($file));
}
}