New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for DatePeriod::__set_state #155

Closed
wants to merge 2 commits into
base: phptestfest-2017-master
from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+30 −0
Diff settings

Always

Just for now

@@ -0,0 +1,13 @@
--TEST--
Testing passing integer to DatePeriod::__set_state should fail.
--CREDITS--
Oscar Merida <oscar@musketeers.me>
#phptestfest2017
--FILE--
<?php
$dp = new \DatePeriod('R4/2012-07-01T00:00:00Z/P7D');
$dp->__set_state(1);
?>
--EXPECTF--
Warning: DatePeriod::__set_state() expects parameter 1 to be array, %s given in %s on line %d

This comment has been minimized.

@carusogabriel

carusogabriel Feb 8, 2019

Collaborator

We won't accept ZPP Failures tests 😕


@@ -0,0 +1,17 @@
--TEST--
Testing passing integer to DatePeriod::__set_state should fail.
--CREDITS--
Oscar Merida <oscar@musketeers.me>
#phptestfest2017
--FILE--
<?php
$dp = new \DatePeriod('R4/2012-07-01T00:00:00Z/P7D');
$dp->__set_state([]);
?>
--EXPECTF--
Fatal error: Uncaught Error: Invalid serialization data for DatePeriod object in %s:%d
Stack trace:
#0 %s(3): DatePeriod::__set_state(Array)
#1 {main}
thrown in %s on line %d

ProTip! Use n and p to navigate between commits in a pull request.