@@ -166,6 +166,22 @@ public function testDontSeeLinkFailsIfTextAndUrlMatches()
166
166
$ this ->module ->dontSeeLink ('Next ' , 'http://codeception.com/ ' );
167
167
}
168
168
169
+ public function testSeeLinkMatchesRelativeLink ()
170
+ {
171
+ $ this ->module ->amOnPage ('/info ' );
172
+ $ this ->module ->seeLink ('Sign in! ' , '/login ' );
173
+ }
174
+
175
+ public function testDontSeeLinkMatchesRelativeLink ()
176
+ {
177
+ $ this ->setExpectedException (
178
+ 'PHPUnit_Framework_AssertionFailedError ' ,
179
+ "Link containing text 'Sign in!' and URL '/login' was found in page /info "
180
+ );
181
+ $ this ->module ->amOnPage ('/info ' );
182
+ $ this ->module ->dontSeeLink ('Sign in! ' , '/login ' );
183
+ }
184
+
169
185
public function testClick ()
170
186
{
171
187
$ this ->module ->amOnPage ('/ ' );
@@ -1623,4 +1639,14 @@ public function testSubmittingRelativeFormHonoursBaseHref()
1623
1639
$ this ->module ->click ('Relative Form ' );
1624
1640
$ this ->module ->seeCurrentUrlEquals ('/form/example5 ' );
1625
1641
}
1642
+
1643
+ public function testAttachFileThrowsCorrectMessageWhenFileDoesNotExist ()
1644
+ {
1645
+ $ filename = 'does-not-exist.jpg ' ;
1646
+ $ expectedMessage = 'File does not exist: ' . codecept_data_dir ($ filename );
1647
+ $ this ->setExpectedException ('InvalidArgumentException ' , $ expectedMessage );
1648
+
1649
+ $ this ->module ->amOnPage ('/form/file ' );
1650
+ $ this ->module ->attachFile ('Avatar ' , $ filename );
1651
+ }
1626
1652
}
0 commit comments