@@ -27,7 +27,7 @@ class MessageTest extends TestCase
2727 /** @test */
2828 public function it_should_sign_a_valid_message ()
2929 {
30- $ fixture = $ this ->getFixture ('message ' );
30+ $ fixture = $ this ->getFixture ('message-v1 ' );
3131
3232 $ message = Message::sign ($ fixture ['data ' ]['message ' ], $ fixture ['passphrase ' ]);
3333
@@ -39,7 +39,7 @@ public function it_should_sign_a_valid_message()
3939 /** @test */
4040 public function it_should_create_a_message_from_an_object ()
4141 {
42- $ fixture = json_decode (json_encode ($ this ->getFixture ('message ' )['data ' ]));
42+ $ fixture = json_decode (json_encode ($ this ->getFixture ('message-v1 ' )['data ' ]));
4343
4444 $ message = Message::new ($ fixture );
4545
@@ -51,7 +51,7 @@ public function it_should_create_a_message_from_an_object()
5151 /** @test */
5252 public function it_should_create_a_message_from_an_array ()
5353 {
54- $ fixture = $ this ->getFixture ('message ' )['data ' ];
54+ $ fixture = $ this ->getFixture ('message-v1 ' )['data ' ];
5555
5656 $ message = Message::new ($ fixture );
5757
@@ -63,7 +63,7 @@ public function it_should_create_a_message_from_an_array()
6363 /** @test */
6464 public function it_should_create_a_message_from_a_string ()
6565 {
66- $ fixture = $ this ->getFixture ('message ' )['data ' ];
66+ $ fixture = $ this ->getFixture ('message-v1 ' )['data ' ];
6767
6868 $ message = Message::new (json_encode ($ fixture ));
6969
@@ -89,33 +89,41 @@ public function it_should_sign_a_message()
8989 }
9090
9191 /** @test */
92- public function it_should_verify_a_message ()
92+ public function it_should_verify_a_message_from_v1 ()
9393 {
94- $ message = Message::new ($ this ->getFixture ('message ' )['data ' ]);
94+ $ message = Message::new ($ this ->getFixture ('message-v1 ' )['data ' ]);
95+
96+ $ this ->assertTrue ($ message ->verify ());
97+ }
98+
99+ /** @test */
100+ public function it_should_verify_a_message_from_v2 ()
101+ {
102+ $ message = Message::new ($ this ->getFixture ('message-v2 ' )['data ' ]);
95103
96104 $ this ->assertTrue ($ message ->verify ());
97105 }
98106
99107 /** @test */
100108 public function it_should_turn_a_message_into_an_array ()
101109 {
102- $ message = Message::new ($ this ->getFixture ('message ' )['data ' ]);
110+ $ message = Message::new ($ this ->getFixture ('message-v1 ' )['data ' ]);
103111
104112 $ this ->assertInternalType ('array ' , $ message ->toArray ());
105113 }
106114
107115 /** @test */
108116 public function it_should_turn_a_message_into_json ()
109117 {
110- $ message = Message::new ($ this ->getFixture ('message ' )['data ' ]);
118+ $ message = Message::new ($ this ->getFixture ('message-v1 ' )['data ' ]);
111119
112120 $ this ->assertInternalType ('string ' , $ message ->toJSON ());
113121 }
114122
115123 /** @test */
116124 public function it_should_turn_a_message_into_a_string ()
117125 {
118- $ message = Message::new ($ this ->getFixture ('message ' )['data ' ]);
126+ $ message = Message::new ($ this ->getFixture ('message-v1 ' )['data ' ]);
119127
120128 $ this ->assertInternalType ('string ' , $ message ->__toString ());
121129 }
0 commit comments