Browse Source

- New tests

experimental/first_unicode_implementation
Felipe Pena 18 years ago
parent
commit
5fb9a8e794
  1. 28
      Zend/tests/bug45910.phpt
  2. 22
      Zend/tests/constants_007.phpt
  3. 17
      Zend/tests/constants_008.phpt
  4. 23
      Zend/tests/constants_009.phpt
  5. 20
      Zend/tests/inter_007.phpt

28
Zend/tests/bug45910.phpt

@ -0,0 +1,28 @@
--TEST--
Bug #45910 (Cannot declare self-referencing constant)
--FILE--
<?php
class foo {
const AAA = 'x';
const BBB = 'a';
const CCC = 'a';
const DDD = self::AAA;
private static $foo = array(
self::BBB => 'a',
self::CCC => 'b',
self::DDD => self::AAA
);
public static function test() {
self::$foo;
}
}
foo::test();
print 1;
?>
--EXPECT--
1

22
Zend/tests/constants_007.phpt

@ -0,0 +1,22 @@
--TEST--
Testing const names
--FILE--
<?php
const a = 'a';
const A = 'b';
class a {
const a = 'c';
const A = 'd';
}
var_dump(a, A, a::a, a::A);
?>
--EXPECT--
unicode(1) "a"
unicode(1) "b"
unicode(1) "c"
unicode(1) "d"

17
Zend/tests/constants_008.phpt

@ -0,0 +1,17 @@
--TEST--
Defining constant twice with two different forms
--FILE--
<?php
define('a', 2);
const a = 1;
if (defined('a')) {
print a;
}
?>
--EXPECTF--
Notice: Constant a already defined in %s on line %d
2

23
Zend/tests/constants_009.phpt

@ -0,0 +1,23 @@
--TEST--
Accessing constants inside namespace
--FILE--
<?php
namespace foo::x;
const x = 2;
class x {
const x = 1;
}
var_dump(namespace::x, x::x, namespace::x::x);
var_dump(defined('foo::x::x'));
?>
--EXPECT--
int(2)
int(1)
int(1)
bool(true)

20
Zend/tests/inter_007.phpt

@ -0,0 +1,20 @@
--TEST--
Trying inherit abstract function twice
--FILE--
<?php
interface d {
static function B();
}
interface c {
function b();
}
class_alias('c', 'w');
interface a extends d, w { }
?>
--EXPECTF--
Fatal error: Can't inherit abstract function c::B() (previously declared abstract in d) in %s on line %d
Loading…
Cancel
Save