Skip to content

Commit

Permalink
Rename add to addAll
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw authored and addshore committed Sep 13, 2018
1 parent 5114c1d commit 6d7b08c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Term/TermList.php
Expand Up @@ -200,7 +200,7 @@ public function clear() {
*
* @param iterable|Term[] $terms
*/
public function add( /* iterable */ $terms ) {
public function addAll( /* iterable */ $terms ) {
foreach ( $terms as $term ) {
$this->setTerm( $term );
}
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/Term/TermListTest.php
Expand Up @@ -413,7 +413,7 @@ public function testWhenAddingTermsToAListThatDoesNotContainThem_theyGetAdded()
$deTerm = new Term( 'de', 'bar' );

$terms = new TermList();
$terms->add( [ $enTerm, $deTerm ] );
$terms->addAll( [ $enTerm, $deTerm ] );

$this->assertEquals( $enTerm, $terms->getByLanguage( 'en' ) );
$this->assertEquals( $deTerm, $terms->getByLanguage( 'de' ) );
Expand All @@ -425,7 +425,7 @@ public function testWhenAddingTermsToAListThatDoesContainThem_theyOverrideTheExi
$newEnTerm = new Term( 'en', 'NEW' );

$terms = new TermList( [ $enTerm ] );
$terms->add( [ $newEnTerm ] );
$terms->addAll( [ $newEnTerm ] );

$this->assertEquals( $newEnTerm, $terms->getByLanguage( 'en' ) );
}
Expand All @@ -435,7 +435,7 @@ public function testWhenAddingTerms_existingOnesAreNotLost() {
$deTerm = new Term( 'de', 'bar' );

$terms = new TermList( [ $enTerm ] );
$terms->add( [ $deTerm ] );
$terms->addAll( [ $deTerm ] );

$this->assertEquals( $enTerm, $terms->getByLanguage( 'en' ) );
}
Expand All @@ -444,15 +444,15 @@ public function testCanAddTermIterables() {
$enTerm = new Term( 'en', 'foo' );

$terms = new TermList();
$terms->add( new TermList( [ $enTerm ] ) );
$terms->addAll( new TermList( [ $enTerm ] ) );

$this->assertEquals( $enTerm, $terms->getByLanguage( 'en' ) );
}

public function testWhenAddingEmptyTerms_theyRemoveExistingOnes() {
$terms = new TermList( [ new Term( 'en', 'not-empty' ) ] );

$terms->add( [ new Term( 'en', '' ) ] );
$terms->addAll( [ new Term( 'en', '' ) ] );

$this->assertEquals( new TermList(), $terms );
}
Expand Down

0 comments on commit 6d7b08c

Please sign in to comment.