1515 * @category Zend
1616 * @package Zend_File
1717 * @subpackage UnitTests
18- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
1919 * @license http://framework.zend.com/license/new-bsd New BSD License
2020 */
2121
2222namespace ZendTest \File ;
2323
24- use Zend \File \ClassFileLocater ;
24+ use Zend \File \ClassFileLocator ,
25+ PHPUnit_Framework_TestCase as TestCase ;
2526
2627/**
27- * Test class for Zend\File\ClassFileLocater
28+ * Test class for Zend\File\ClassFileLocator
2829 *
2930 * @category Zend
3031 * @package Zend_File
3132 * @subpackage UnitTests
32- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
33+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
3334 * @license http://framework.zend.com/license/new-bsd New BSD License
3435 * @group Zend_File
3536 */
36- class ClassFileLocaterTest extends \PHPUnit_Framework_TestCase
37+ class ClassFileLocatorTest extends TestCase
3738{
3839
3940 public function testConstructorThrowsInvalidArgumentExceptionForInvalidStringDirectory ()
4041 {
4142 $ this ->setExpectedException ('Zend\File\Exception\InvalidArgumentException ' );
42- $ locater = new ClassFileLocater ('__foo__ ' );
43+ $ locator = new ClassFileLocator ('__foo__ ' );
4344 }
4445
4546 public function testConstructorThrowsInvalidArgumentExceptionForNonDirectoryIteratorArgument ()
4647 {
4748 $ iterator = new \ArrayIterator (array ());
4849 $ this ->setExpectedException ('Zend\File\Exception\InvalidArgumentException ' );
49- $ locater = new ClassFileLocater ($ iterator );
50+ $ locator = new ClassFileLocator ($ iterator );
5051 }
5152
5253 public function testIterationShouldReturnOnlyPhpFiles ()
5354 {
54- $ locater = new ClassFileLocater (__DIR__ );
55- foreach ($ locater as $ file ) {
55+ $ locator = new ClassFileLocator (__DIR__ );
56+ foreach ($ locator as $ file ) {
5657 $ this ->assertRegexp ('/\.php$/ ' , $ file ->getFilename ());
5758 }
5859 }
5960
6061 public function testIterationShouldReturnOnlyPhpFilesContainingClasses ()
6162 {
62- $ locater = new ClassFileLocater (__DIR__ );
63+ $ locator = new ClassFileLocator (__DIR__ );
6364 $ found = false ;
64- foreach ($ locater as $ file ) {
65- if (preg_match ('/locater -should-skip-this\.php$/ ' , $ file ->getFilename ())) {
65+ foreach ($ locator as $ file ) {
66+ if (preg_match ('/locator -should-skip-this\.php$/ ' , $ file ->getFilename ())) {
6667 $ found = true ;
6768 }
6869 }
@@ -71,30 +72,30 @@ public function testIterationShouldReturnOnlyPhpFilesContainingClasses()
7172
7273 public function testIterationShouldReturnInterfaces ()
7374 {
74- $ locater = new ClassFileLocater (__DIR__ );
75+ $ locator = new ClassFileLocator (__DIR__ );
7576 $ found = false ;
76- foreach ($ locater as $ file ) {
77- if (preg_match ('/LocaterShouldFindThis \.php$/ ' , $ file ->getFilename ())) {
77+ foreach ($ locator as $ file ) {
78+ if (preg_match ('/LocatorShouldFindThis \.php$/ ' , $ file ->getFilename ())) {
7879 $ found = true ;
7980 }
8081 }
81- $ this ->assertTrue ($ found , "Locater skipped an interface? " );
82+ $ this ->assertTrue ($ found , "Locator skipped an interface? " );
8283 }
8384
8485 public function testIterationShouldInjectNamespaceInFoundItems ()
8586 {
86- $ locater = new ClassFileLocater (__DIR__ );
87+ $ locator = new ClassFileLocator (__DIR__ );
8788 $ found = false ;
88- foreach ($ locater as $ file ) {
89+ foreach ($ locator as $ file ) {
8990 $ this ->assertTrue (isset ($ file ->namespace ));
9091 }
9192 }
9293
9394 public function testIterationShouldInjectClassInFoundItems ()
9495 {
95- $ locater = new ClassFileLocater (__DIR__ );
96+ $ locator = new ClassFileLocator (__DIR__ );
9697 $ found = false ;
97- foreach ($ locater as $ file ) {
98+ foreach ($ locator as $ file ) {
9899 $ this ->assertTrue (isset ($ file ->classname ));
99100 }
100101 }
0 commit comments