public function testCanSetExceptions() { $ex = new \Exception('foo'); $e = new ExceptionCollection(); $e->setExceptions(array($ex)); $this->assertSame($ex, $e->getFirst()); }
public function testAggregatesExceptions() { $e = new ExceptionCollection(); $exceptions = $this->getExceptions(); $e->add($exceptions[0]); $e->add($exceptions[1]); $this->assertEquals("Test\nTesting", $e->getMessage()); $this->assertSame($exceptions[0], $e->getFirst()); }