close Warning: AdminModule failed with TracError: Unable to instantiate component <class 'trac.admin.web_ui.BasicsAdminPanel'> (super(type, obj): obj (type BasicsAdminPanel) is not an instance or subtype of type (Markup).)

source: externals/php/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php@ 7271978

Last change on this file since 7271978 was 01a620f, checked in by Joachim Langenbach <joachim.langenbach@…>, 11 years ago

Removed submodules for php externals and use composer to provide them and versioned them afterwards

  • Property mode set to 100644
File size: 1003 bytes
Line 
1<?php
2namespace GuzzleHttp\Promise\Tests;
3
4use GuzzleHttp\Promise\RejectionException;
5
6class Thing1
7{
8 public function __construct($message)
9 {
10 $this->message = $message;
11 }
12
13 public function __toString()
14 {
15 return $this->message;
16 }
17}
18
19class Thing2 implements \JsonSerializable
20{
21 public function jsonSerialize()
22 {
23 return '{}';
24 }
25}
26
27/**
28 * @covers GuzzleHttp\Promise\RejectionException
29 */
30class RejectionExceptionTest extends \PHPUnit_Framework_TestCase
31{
32 public function testCanGetReasonFromException()
33 {
34 $thing = new Thing1('foo');
35 $e = new RejectionException($thing);
36
37 $this->assertSame($thing, $e->getReason());
38 $this->assertEquals('The promise was rejected with reason: foo', $e->getMessage());
39 }
40
41 public function testCanGetReasonMessageFromJson()
42 {
43 $reason = new Thing2();
44 $e = new RejectionException($reason);
45 $this->assertContains("{}", $e->getMessage());
46 }
47}
Note: See TracBrowser for help on using the repository browser.