Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 5883d28

Browse files
committed
Merge branch 'master' of git://github.com/zendframework/zf2
27 parents c1063c5 + 518460f + 63a6a3b + f21d820 + 5b80282 + 8d4f7c0 + 3428c24 + 50a5cf9 + 0fcf91c + ffd0e6c + 90cc750 + 4c0cba4 + 9e64972 + 3a86f54 + f4931d8 + 9c496b9 + f36d38f + 1b580df + dab01ce + bc6e247 + 96739b6 + e1b5376 + 1c7183f + 0e68ed1 + 5b3198f + 929c939 + f7e2963 commit 5883d28

File tree

9 files changed

+31
-48
lines changed

9 files changed

+31
-48
lines changed

src/ClassFileLocater.php renamed to src/ClassFileLocator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
* @package Zend_File
1717
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
1818
*/
19-
class ClassFileLocater extends FilterIterator
19+
class ClassFileLocator extends FilterIterator
2020
{
2121
/**
22-
* Create an instance of the locater iterator
22+
* Create an instance of the locator iterator
2323
*
2424
* Expects either a directory, or a DirectoryIterator (or its recursive variant)
2525
* instance.

src/Transfer/Adapter/AbstractAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Zend\File\Transfer\Exception,
2828
Zend\Loader\PrefixPathLoader,
2929
Zend\Loader\PrefixPathMapper,
30-
Zend\Loader\ShortNameLocater,
30+
Zend\Loader\ShortNameLocator,
3131
Zend\Validator,
3232
Zend\Filter;
3333

@@ -223,12 +223,12 @@ abstract public function isFiltered($files = null);
223223
/**
224224
* Set plugin loader to use for validator or filter chain
225225
*
226-
* @param \Zend\Loader\PrefixPathMapper $loader
226+
* @param \Zend\Loader\ShortNameLocator $loader
227227
* @param string $type 'filter', or 'validator'
228228
* @return \Zend\File\Transfer\Adapter\AbstractAdapter
229229
* @throws \Zend\File\Transfer\Exception on invalid type
230230
*/
231-
public function setPluginLoader(ShortNameLocater $loader, $type)
231+
public function setPluginLoader(ShortNameLocator $loader, $type)
232232
{
233233
$type = strtoupper($type);
234234
switch ($type) {
@@ -248,7 +248,7 @@ public function setPluginLoader(ShortNameLocater $loader, $type)
248248
* 'filter' or 'validator' for $type.
249249
*
250250
* @param string $type
251-
* @return \Zend\Loader\ShortNameLocater
251+
* @return \Zend\Loader\ShortNameLocator
252252
* @throws \Zend\File\Transfer\Exception on invalid type.
253253
*/
254254
public function getPluginLoader($type)

src/Transfer/Exception.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,12 @@
2626
/**
2727
* Exception class for Zend_File_Transfer
2828
*
29-
* @uses \Zend\Exception
3029
* @category Zend
3130
* @package Zend_File_Transfer
3231
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
3332
* @license http://framework.zend.com/license/new-bsd New BSD License
3433
*/
3534
interface Exception
3635
{
37-
// protected $_fileerror = null;
38-
//
39-
// public function __construct($message, $fileerror = 0)
40-
// {
41-
// $this->_fileerror = $fileerror;
42-
// parent::__construct($message);
43-
// }
44-
//
45-
// /**
46-
// * Returns the transfer error code for the exception
47-
// * This is not the exception code !!!
48-
// *
49-
// * @return integer
50-
// */
51-
// public function getFileError()
52-
// {
53-
// return $this->_fileerror;
54-
// }
36+
5537
}

test/ClassFileLocater.php renamed to test/ClassFileLocatorTest.php

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121

2222
namespace 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
@@ -33,36 +34,36 @@
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
}

test/TestAsset/LocaterShouldFindThis.php renamed to test/TestAsset/LocatorShouldFindThis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
2828
* @license http://framework.zend.com/license/new-bsd New BSD License
2929
*/
30-
interface LocaterShouldFindThis
30+
interface LocatorShouldFindThis
3131
{
3232
}

test/Transfer/Adapter/AbstractTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
namespace ZendTest\File\Transfer\Adapter;
2626

2727
use Zend\Loader\PrefixPathLoader,
28-
Zend\Loader\ShortNameLocater,
28+
Zend\Loader\ShortNameLocator,
2929
Zend\Validator\File,
3030
Zend\Filter,
3131
Zend\File\Transfer;
@@ -339,7 +339,7 @@ public function testErrorCodesShouldBePopulatedAfterInvalidTransfer()
339339
public function testAdapterShouldHavePluginLoaderForFilters()
340340
{
341341
$loader = $this->adapter->getPluginLoader('filter');
342-
$this->assertTrue($loader instanceof ShortNameLocater);
342+
$this->assertTrue($loader instanceof ShortNameLocator);
343343
}
344344

345345
public function testFilterPluginLoaderShouldRegisterPathsForBaseAndFileFiltersByDefault()

test/_files/locater-should-skip-this.php

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
// Locator should skip this file; no classes in it

0 commit comments

Comments
 (0)