2 class Issue1351Test extends PHPUnit_Framework_TestCase
7 * @runInSeparateProcess
9 public function testFailurePre()
11 $this->instance = new ChildProcessClass1351();
12 $this->assertFalse(true, 'Expected failure.');
15 public function testFailurePost()
17 $this->assertNull($this->instance);
18 $this->assertFalse(class_exists('ChildProcessClass1351', false), 'ChildProcessClass1351 is not loaded.');
22 * @runInSeparateProcess
24 public function testExceptionPre()
26 $this->instance = new ChildProcessClass1351();
28 throw new LogicException('Expected exception.');
29 } catch (LogicException $e) {
30 throw new RuntimeException('Expected rethrown exception.', 0, $e);
34 public function testExceptionPost()
36 $this->assertNull($this->instance);
37 $this->assertFalse(class_exists('ChildProcessClass1351', false), 'ChildProcessClass1351 is not loaded.');
40 public function testPhpCoreLanguageException()
42 // User-space code cannot instantiate a PDOException with a string code,
43 // so trigger a real one.
44 $connection = new PDO('sqlite::memory:');
45 $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
46 $connection->query("DELETE FROM php_wtf WHERE exception_code = 'STRING'");