Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CompoundKeyTraitTest and removing unused functions from Compou…
…ndKeyTrait.
- Loading branch information
Jeremy Sik
committed
Oct 23, 2015
1 parent
9e0ceb7
commit 4c20c9b
Showing
2 changed files
with
43 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Spira framework. | ||
* | ||
* @link https://github.com/spira/spira | ||
* | ||
* For the full copyright and license information, please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
use App\Models\Localization; | ||
|
||
/** | ||
* Class CompoundKeyTraitTest. | ||
*/ | ||
class CompoundKeyTraitTest extends TestCase | ||
{ | ||
/** | ||
* @expectedException LogicException | ||
* @expectedExceptionCode 0 | ||
*/ | ||
public function testBootCompoundKeyTrait() | ||
{ | ||
|
||
MockSinglePK::bootCompoundKeyTrait(); | ||
|
||
} | ||
|
||
public function testGetQualifiedColumnName() | ||
{ | ||
$localization = new Localization(); | ||
|
||
$qualifiedColumnName = $localization->getQualifiedColumnName('region_code'); | ||
|
||
$this->assertEquals($qualifiedColumnName, 'localizations.region_code'); | ||
} | ||
|
||
} | ||
|
||
class MockSinglePK extends Localization | ||
{ | ||
protected $primaryKey = 'foo_id'; | ||
} |