Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request mensler#13 from mensler/validator-c2-update
Browse files Browse the repository at this point in the history
Added method 3 to validator C2, fixes mensler#12
  • Loading branch information
mensler authored Sep 1, 2017
2 parents ba7c62a + 80ed60a commit 054f40a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 1 addition & 3 deletions classes/validator/validators/ValidatorC2.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public function __construct(Bank $bank)
parent::__construct($bank);

$this->validators[] = new Validator22($bank);
$this->validators[0]->setWeights(array(3, 1));

$this->validators[] = new Validator00($bank);
$this->validators[1]->setWeights(array(2, 1));
$this->validators[] = new Validator04($bank);
}
}
8 changes: 4 additions & 4 deletions tests/unit/BAVFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BAVFacadeTest extends TestCase
public function testGetBank()
{
$bav = new BAV();
$bank = $bav->getBank("73362421");
$bank = $bav->getBank("10011001");
$this->assertNotNull($bank);
}

Expand Down Expand Up @@ -61,7 +61,7 @@ public function testFailGetAgencies()
public function provideTestGetAgencies()
{
return array(
array("73362421", 0),
array("10011001", 0),
array("10070000", 2),
array("10020890", 4),
);
Expand All @@ -88,7 +88,7 @@ public function testGetAgencies($bankID, $count)
public function testGetMainAgency()
{
$bav = new BAV();
$agency = $bav->getMainAgency("73362421");
$agency = $bav->getMainAgency("10011001");
$this->assertNotNull($agency);
}

Expand All @@ -113,7 +113,7 @@ public function testFailGetMainAgency()
public function provideTestIsValidBank()
{
return array(
array("73362421", true),
array("10011001", true),
array("12345678", false),
);
}
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/validators/ValidatorC2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ public function provideTestData()

['0328705282', false],
['9024675131', false],
['9024675131', false],

// Variant 2
['5127485166', true],
['8738142564', true],

// Variant 3
['0076543216', true],
['3456789012', true],
['9024675138', true],
];
}
}

0 comments on commit 054f40a

Please sign in to comment.