Skip to content

Commit 52452c8

Browse files
committed
Enable deprecation messages in test suite
1 parent d5726a5 commit 52452c8

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<php>
1313
<ini name="display_errors" value="On" />
1414
<ini name="display_startup_errors" value="On" />
15+
<ini name="error_reporting" value="-1" />
1516
<env name="MYSQLI_HOST" value="localhost"/>
1617
<env name="MYSQLI_USER" value="root"/>
1718
<env name="MYSQLI_PASS" value=""/>

tests/KintTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class KintTestCase extends TestCase
7070
protected $serialize_safe_mode;
7171
protected $serialize_allowed_classes;
7272
protected $trace_plugin_blacklist;
73+
protected $trace_plugin_path_blacklist;
7374
protected $xml_plugin_method;
7475
protected $dom_plugin_blacklist;
7576
protected $dom_plugin_verbose;

tests/Parser/MysqliPluginTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,25 @@ public function testBadParse()
105105
$v = new Mysqli();
106106

107107
$o = $p->parse($v, clone $b);
108-
$o->value = null;
109108

110109
$mp = new MysqliPlugin($p);
111110

112111
$p->addPlugin($mp);
113112

114-
$out = $mp->parseComplete($v, $o, Parser::TRIGGER_BEGIN);
113+
$out = $mp->parseComplete($v, clone $o, Parser::TRIGGER_BEGIN);
114+
$this->assertNotEquals($out, $o);
115115

116-
$this->assertSame($out, $o);
116+
$o->setChildren([]);
117+
$o->removeRepresentation('properties');
118+
119+
$out = $mp->parseComplete($v, clone $o, Parser::TRIGGER_BEGIN);
120+
$this->assertEquals($out, $o);
117121

118122
$rep = new StringRepresentation('Contents', 'value');
119123
$o->addRepresentation($rep);
120124

121-
$out = $mp->parseComplete($v, $o, Parser::TRIGGER_BEGIN);
122-
123-
$this->assertSame($out, $o);
125+
$out = $mp->parseComplete($v, clone $o, Parser::TRIGGER_BEGIN);
126+
$this->assertEquals($out, $o);
124127
}
125128

126129
/**
@@ -229,7 +232,8 @@ public function testParseExtraParams()
229232
$this->markTestSkipped('Mysqli connection error. Check connection information in phpunit.xml');
230233
}
231234

232-
$v->testvar = 'Hello world';
235+
// Suppress deprecation message
236+
@$v->testvar = 'Hello world';
233237

234238
$obj1 = $p->parse($v, clone $base);
235239

tests/Parser/ParserTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ public function testParseObject()
369369
$b = new BaseContext('List');
370370
$b->access_path = '$v';
371371
$v = new ChildTestClass();
372-
$v->dynadded = 'value';
372+
// Suppress deprecation message
373+
@$v->dynadded = 'value';
373374

374375
$o = $p->parse($v, clone $b);
375376

@@ -643,7 +644,8 @@ public function testParseObjectNotReliantOnArrayCast()
643644
$b = new BaseContext('$v');
644645
$b->access_path = '$v';
645646
$v = new DateTime();
646-
$v->test = 'value';
647+
// Suppress deprecation message
648+
@$v->test = 'value';
647649

648650
$o = $p->parse($v, clone $b);
649651

tests/bootstrap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@
2828
if (KINT_PHP81) {
2929
\class_alias(Kint\Test\Fixtures\Mysqli81TestClass::class, Kint\Test\Fixtures\MysqliTestClass::class);
3030
}
31+
32+
if (KINT_PHP82) {
33+
$error_reporting = \error_reporting();
34+
\error_reporting($error_reporting & ~E_DEPRECATED);
35+
36+
\class_exists(Kint\Test\Fixtures\TestClass::class);
37+
\class_exists(Kint\Test\Fixtures\Php71TestClass::class);
38+
\class_exists(Kint\Test\Fixtures\Php8TestClass::class);
39+
40+
\error_reporting($error_reporting);
41+
unset($error_reporting);
42+
}

0 commit comments

Comments
 (0)