Development

Changeset 8645

You must first sign up to be able to contribute.

Changeset 8645

Show
Ignore:
Timestamp:
04/27/08 17:37:17 (3 months ago)
Author:
fabien
Message:

fixed tests that failed on case sensitive filesystem and with slightly different default PHP configuration

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/form/AttachmentForm.class.php

    r8535 r8645  
    1313  { 
    1414    $this->widgetSchema['file'] = new sfWidgetFormInputFile(); 
    15     $this->validatorSchema['file'] = new sfValidatorFile(); 
     15 
     16    $fileValidator = new sfValidatorFile(); 
     17    $fileValidator->setOption('mime_type_guessers', array()); 
     18    $this->validatorSchema['file'] = $fileValidator; 
    1619  } 
    1720} 
  • branches/1.1/test/functional/fixtures/project/apps/i18n/modules/i18n/actions/actions.class.php

    r8610 r8645  
    4343  { 
    4444    $this->form = new I18nCustomCatalogueForm(); 
    45     $this->setTemplate('I18nForm'); 
     45    $this->setTemplate('i18nForm'); 
    4646  } 
    4747} 
  • branches/1.1/test/unit/plugin/sfPluginManagerTest.php

    r6218 r8645  
    183183$pluginManager->installPlugin('sfTestPlugin'); 
    184184$installed = $pluginManager->getInstalledPlugins(); 
    185 $t->is($installed[1]->getName(), 'sfTestPlugin', '->getInstalledPlugin() returns an array of installed packages'); 
     185$a = array($installed[0]->getName(), $installed[1]->getName()); 
     186$b = array('sfTestPlugin', 'sfMainPackage'); 
     187sort($a); 
     188sort($b); 
     189$t->is($a, $b, '->getInstalledPlugin() returns an array of installed packages'); 
    186190$t->is(count($installed), 2, '->getInstalledPlugin() returns an array of installed packages'); 
    187191$pluginManager->uninstallPlugin('sfTestPlugin'); 
  • branches/1.1/test/unit/plugin/sfPluginTestHelper.class.php

    r5250 r8645  
    55  static public function convertUrlToFixture($url) 
    66  { 
    7     $file = preg_replace(array('/_+/', '#/+#', '#_/#'), array('_', '/', '/'), preg_replace('#[^a-zA-Z0-9\-/\.]#', '_', strtolower($url))); 
     7    $file = preg_replace(array('/_+/', '#/+#', '#_/#'), array('_', '/', '/'), preg_replace('#[^a-zA-Z0-9\-/\.]#', '_', $url)); 
    88 
    99    $dir  = dirname($file); 
  • branches/1.1/test/unit/util/sfFinderTest.php

    r8390 r8645  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(37, new lime_output_color()); 
     13class my_lime_test extends lime_test 
     14
     15  public function arrays_are_equal($a, $b, $message) 
     16  { 
     17    sort($a); 
     18    sort($b); 
     19 
     20    return $this->is($a, $b, $message); 
     21  } 
     22
     23$t = new my_lime_test(37, new lime_output_color()); 
    1424 
    1525require_once($_test_dir.'/../lib/util/sfFinder.class.php'); 
     
    101111$t->diag('->name() file name support'); 
    102112$finder = sfFinder::type('file')->name('file21.php')->relative(); 
    103 $t->is($finder->in($fixtureDir), array('dir1/dir2/file21.php'), '->name() can take a file name as an argument'); 
     113$t->arrays_are_equal($finder->in($fixtureDir), array('dir1/dir2/file21.php'), '->name() can take a file name as an argument'); 
    104114 
    105115$t->diag('->name() globs support'); 
    106116$finder = sfFinder::type('file')->name('*.php')->relative(); 
    107 $t->is($finder->in($fixtureDir), $phpFiles, '->name() can take a glob pattern as an argument'); 
     117$t->arrays_are_equal($finder->in($fixtureDir), $phpFiles, '->name() can take a glob pattern as an argument'); 
    108118 
    109119$t->diag('->name() regexp support'); 
    110120$finder = sfFinder::type('file')->name('/^file2.*$/')->relative(); 
    111 $t->is($finder->in($fixtureDir), $regexpFiles, '->name() can take a regexp as an argument'); 
     121$t->arrays_are_equal($finder->in($fixtureDir), $regexpFiles, '->name() can take a regexp as an argument'); 
    112122 
    113123$t->diag('->name() array / args / chaining'); 
    114124$finder = sfFinder::type('file')->name(array('*.php', '*.txt'))->relative(); 
    115 $t->is($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take an array of patterns'); 
     125$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take an array of patterns'); 
    116126$finder = sfFinder::type('file')->name('*.php', '*.txt')->relative(); 
    117 $t->is($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take patterns as arguments'); 
     127$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take patterns as arguments'); 
    118128$finder = sfFinder::type('file')->name('*.php')->name('*.txt')->relative(); 
    119 $t->is($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can be called several times'); 
     129$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can be called several times'); 
    120130 
    121131// ->not_name() 
     
    126136$t->diag('->not_name() file name support'); 
    127137$finder = sfFinder::type('file')->not_name('file21.php')->relative(); 
    128 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, array('dir1/dir2/file21.php'))), '->not_name() can take a file name as an argument'); 
     138$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array('dir1/dir2/file21.php'))), '->not_name() can take a file name as an argument'); 
    129139 
    130140$t->diag('->not_name() globs support'); 
    131141$finder = sfFinder::type('file')->not_name('*.php')->relative(); 
    132 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->not_name() can take a glob pattern as an argument'); 
     142$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->not_name() can take a glob pattern as an argument'); 
    133143 
    134144$t->diag('->not_name() regexp support'); 
    135145$finder = sfFinder::type('file')->not_name('/^file2.*$/')->relative(); 
    136 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->not_name() can take a regexp as an argument'); 
     146$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->not_name() can take a regexp as an argument'); 
    137147 
    138148$t->diag('->not_name() array / args / chaining'); 
    139149$finder = sfFinder::type('file')->not_name(array('*.php', '*.txt'))->relative(); 
    140 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take an array of patterns'); 
     150$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take an array of patterns'); 
    141151$finder = sfFinder::type('file')->not_name('*.php', '*.txt')->relative(); 
    142 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take patterns as arguments'); 
     152$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take patterns as arguments'); 
    143153$finder = sfFinder::type('file')->not_name('*.php')->not_name('*.txt')->relative(); 
    144 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can be called several times'); 
     154$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can be called several times'); 
    145155 
    146156$t->diag('->name() ->not_name() in the same query'); 
    147157$finder = sfFinder::type('file')->not_name('/^file2.*$/')->name('*.php')->relative(); 
    148 $t->is($finder->in($fixtureDir), array('dir1/file12.php'), '->not_name() and ->name() can be called in the same query'); 
     158$t->arrays_are_equal($finder->in($fixtureDir), array('dir1/file12.php'), '->not_name() and ->name() can be called in the same query'); 
    149159 
    150160// ->size() 
     
    167177 
    168178$finder = sfFinder::type('file')->relative()->mindepth(1); 
    169 $t->is($finder->in($fixtureDir), $minDepth1Files, '->mindepth() takes a minimum depth as its argument'); 
     179$t->arrays_are_equal($finder->in($fixtureDir), $minDepth1Files, '->mindepth() takes a minimum depth as its argument'); 
    170180$finder = sfFinder::type('file')->relative()->maxdepth(2); 
    171 $t->is($finder->in($fixtureDir), $maxDepth2Files, '->maxdepth() takes a maximum depth as its argument'); 
     181$t->arrays_are_equal($finder->in($fixtureDir), $maxDepth2Files, '->maxdepth() takes a maximum depth as its argument'); 
    172182$finder = sfFinder::type('file')->relative()->mindepth(1)->maxdepth(2); 
    173 $t->is($finder->in($fixtureDir), array_values(array_intersect($minDepth1Files, $maxDepth2Files)), '->maxdepth() and ->mindepth() can be called in the same query'); 
     183$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_intersect($minDepth1Files, $maxDepth2Files)), '->maxdepth() and ->mindepth() can be called in the same query'); 
    174184 
    175185// ->discard() 
     
    179189$t->diag('->discard() file name support'); 
    180190$finder = sfFinder::type('file')->relative()->discard('file2.txt'); 
    181 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, array('file2.txt'))), '->discard() can discard a file name'); 
     191$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array('file2.txt'))), '->discard() can discard a file name'); 
    182192 
    183193$t->diag('->discard() glob support'); 
    184194$finder = sfFinder::type('file')->relative()->discard('*.php'); 
    185 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->discard() can discard a glob pattern'); 
     195$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->discard() can discard a glob pattern'); 
    186196 
    187197$t->diag('->discard() regexp support'); 
    188198$finder = sfFinder::type('file')->relative()->discard('/^file2.*$/'); 
    189 $t->is($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->discard() can discard a regexp pattern'); 
     199$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->discard() can discard a regexp pattern'); 
    190200 
    191201// ->prune() 
     
    194204 
    195205$finder = sfFinder::type('any')->relative()->prune('dir2'); 
    196 $t->is($finder->in($fixtureDir), $anyWithoutDir2, '->prune() ignore all files/directories under the given directory'); 
     206$t->arrays_are_equal($finder->in($fixtureDir), $anyWithoutDir2, '->prune() ignore all files/directories under the given directory');