1--TEST--
2Test ReflectionProperty::export() errors.
3--FILE--
4<?php
5
6class TestClass {
7}
8
9$a = 5;
10
11echo "Non-existent class:\n";
12try {
13    ReflectionProperty::export("NonExistentClass", "prop", true);
14}
15catch(Exception $e) {
16    echo $e->getMessage();
17}
18
19echo "\n\nWrong property parameter type:\n";
20try {
21    ReflectionProperty::export($a, 'TestClass', false);
22}
23catch(ReflectionException $e) {
24    echo $e->getMessage();
25}
26
27echo "\n\nNon-existent property:\n";
28try {
29    ReflectionProperty::export('TestClass', "nonExistentProperty", true);
30}
31catch(Exception $e) {
32    echo $e->getMessage();
33}
34
35echo "\n\nIncorrect number of args:\n";
36ReflectionProperty::export();
37ReflectionProperty::export('TestClass', "nonExistentProperty", true, false);
38
39?>
40--EXPECTF--
41Non-existent class:
42
43Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d
44Class NonExistentClass does not exist
45
46Wrong property parameter type:
47
48Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d
49The parameter class is expected to be either a string or an object
50
51Non-existent property:
52
53Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d
54Property TestClass::$nonExistentProperty does not exist
55
56Incorrect number of args:
57
58Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d
59
60Warning: ReflectionProperty::export() expects at least 2 parameters, 0 given in %s on line %d
61
62Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d
63
64Warning: ReflectionProperty::export() expects at most 3 parameters, 4 given in %s on line %d
65