@@ -166,6 +166,22 @@ public function testDontSeeLinkFailsIfTextAndUrlMatches()
166166 $ this ->module ->dontSeeLink ('Next ' , 'http://codeception.com/ ' );
167167 }
168168
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+
169185 public function testClick ()
170186 {
171187 $ this ->module ->amOnPage ('/ ' );
@@ -1623,4 +1639,14 @@ public function testSubmittingRelativeFormHonoursBaseHref()
16231639 $ this ->module ->click ('Relative Form ' );
16241640 $ this ->module ->seeCurrentUrlEquals ('/form/example5 ' );
16251641 }
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+ }
16261652}
0 commit comments