MFB tests for __DIR__

This commit is contained in:
Stanislav Malyshev 2008-02-12 00:46:32 +00:00
parent b1ed2e8059
commit 8596cc0273
24 changed files with 169 additions and 0 deletions

View file

@ -0,0 +1,8 @@
--TEST--
__DIR__ constant used with eval()
--FILE--
<?php
eval('echo __DIR__ . "\n";');
?>
--EXPECTF--
%s/tests/constants

View file

@ -0,0 +1,22 @@
--TEST--
__DIR__ constant test with includes
--FILE--
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";
include 'fixtures/folder1/fixture.php';
include 'fixtures/folder2/fixture.php';
include 'fixtures/folder3/fixture.php';
include 'fixtures/folder4/fixture.php';
?>
--EXPECTF--
%s/tests/constants
%s/tests/constants
%s/tests/constants/fixtures/folder1
%s/tests/constants/fixtures/folder1
%s/tests/constants/fixtures/folder2
%s/tests/constants/fixtures/folder2
%s/tests/constants/fixtures/folder3
%s/tests/constants/fixtures/folder3
%s/tests/constants/fixtures/folder4
%s/tests/constants/fixtures/folder4

View file

@ -0,0 +1,70 @@
--TEST--
__DIR__ constant test with nested includes
--FILE--
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";
include 'fixtures/folder1/fixture.php';
include 'fixtures/folder1/subfolder1/fixture.php';
include 'fixtures/folder1/subfolder2/fixture.php';
include 'fixtures/folder1/subfolder3/fixture.php';
include 'fixtures/folder1/subfolder4/fixture.php';
include 'fixtures/folder2/fixture.php';
include 'fixtures/folder2/subfolder1/fixture.php';
include 'fixtures/folder2/subfolder2/fixture.php';
include 'fixtures/folder2/subfolder3/fixture.php';
include 'fixtures/folder2/subfolder4/fixture.php';
include 'fixtures/folder3/fixture.php';
include 'fixtures/folder3/subfolder1/fixture.php';
include 'fixtures/folder3/subfolder2/fixture.php';
include 'fixtures/folder3/subfolder3/fixture.php';
include 'fixtures/folder3/subfolder4/fixture.php';
include 'fixtures/folder4/fixture.php';
include 'fixtures/folder4/subfolder1/fixture.php';
include 'fixtures/folder4/subfolder2/fixture.php';
include 'fixtures/folder4/subfolder3/fixture.php';
include 'fixtures/folder4/subfolder4/fixture.php';
?>
--EXPECTF--
%s/tests/constants
%s/tests/constants
%s/tests/constants/fixtures/folder1
%s/tests/constants/fixtures/folder1
%s/tests/constants/fixtures/folder1/subfolder1
%s/tests/constants/fixtures/folder1/subfolder1
%s/tests/constants/fixtures/folder1/subfolder2
%s/tests/constants/fixtures/folder1/subfolder2
%s/tests/constants/fixtures/folder1/subfolder3
%s/tests/constants/fixtures/folder1/subfolder3
%s/tests/constants/fixtures/folder1/subfolder4
%s/tests/constants/fixtures/folder1/subfolder4
%s/tests/constants/fixtures/folder2
%s/tests/constants/fixtures/folder2
%s/tests/constants/fixtures/folder2/subfolder1
%s/tests/constants/fixtures/folder2/subfolder1
%s/tests/constants/fixtures/folder2/subfolder2
%s/tests/constants/fixtures/folder2/subfolder2
%s/tests/constants/fixtures/folder2/subfolder3
%s/tests/constants/fixtures/folder2/subfolder3
%s/tests/constants/fixtures/folder2/subfolder4
%s/tests/constants/fixtures/folder2/subfolder4
%s/tests/constants/fixtures/folder3
%s/tests/constants/fixtures/folder3
%s/tests/constants/fixtures/folder3/subfolder1
%s/tests/constants/fixtures/folder3/subfolder1
%s/tests/constants/fixtures/folder3/subfolder2
%s/tests/constants/fixtures/folder3/subfolder2
%s/tests/constants/fixtures/folder3/subfolder3
%s/tests/constants/fixtures/folder3/subfolder3
%s/tests/constants/fixtures/folder3/subfolder4
%s/tests/constants/fixtures/folder3/subfolder4
%s/tests/constants/fixtures/folder4
%s/tests/constants/fixtures/folder4
%s/tests/constants/fixtures/folder4/subfolder1
%s/tests/constants/fixtures/folder4/subfolder1
%s/tests/constants/fixtures/folder4/subfolder2
%s/tests/constants/fixtures/folder4/subfolder2
%s/tests/constants/fixtures/folder4/subfolder3
%s/tests/constants/fixtures/folder4/subfolder3
%s/tests/constants/fixtures/folder4/subfolder4
%s/tests/constants/fixtures/folder4/subfolder4

View file

@ -0,0 +1,9 @@
--TEST--
Standard behaviour of __DIR__
--FILE--
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";
--EXPECTF--
%s/tests/constants
%s/tests/constants

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";

View file

@ -0,0 +1,3 @@
<?php
echo __DIR__ . "\n";
echo dirname(__FILE__) . "\n";