Skip to content

Commit c5c8229

Browse files
committed
Add tests for invalid argument exceptions
1 parent af52c91 commit c5c8229

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/unit/Term/TermListTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,16 @@ public function testCanConstructWithIterables() {
467467
$this->assertEquals( $deTerm, $terms->getByLanguage( 'de' ) );
468468
}
469469

470+
public function testWhenProvidingNonTerms_constructorThrowsException() {
471+
$this->setExpectedException( InvalidArgumentException::class );
472+
new TermList( [ 'no-a-term' ] );
473+
}
474+
475+
public function testWhenProvidingNonTerms_addAllThrowsException() {
476+
$list = new TermList( [] );
477+
478+
$this->setExpectedException( InvalidArgumentException::class );
479+
$list->addAll( [ 'no-a-term' ] );
480+
}
481+
470482
}

0 commit comments

Comments
 (0)