Skip to content

Commit d415b44

Browse files
committed
Improving code coverage
1 parent 0c3bce4 commit d415b44

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

src/TDBMObject.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,4 @@ protected function getUsedTables() : array
8181

8282
return $tableNames;
8383
}
84-
85-
/**
86-
* @return mixed[]
87-
*/
88-
protected function _getRelationshipPathArray(): array
89-
{
90-
return [];
91-
}
9284
}

tests/AbstractTDBMObjectTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace TheCodingMachine\TDBM;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
class AbstractTDBMObjectTest extends TestCase
8+
{
9+
10+
public function testGetManyToManyRelationshipDescriptor()
11+
{
12+
$object = new TDBMObject();
13+
$this->expectException(TDBMException::class);
14+
$this->expectExceptionMessage('Could not find many to many relationship descriptor key for "foo"');
15+
$object->_getManyToManyRelationshipDescriptor('foo');
16+
}
17+
}

tests/TDBMObjectTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace TheCodingMachine\TDBM;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
class TDBMObjectTest extends TestCase
8+
{
9+
10+
public function testJsonSerialize()
11+
{
12+
$object = new TDBMObject();
13+
$this->expectException(TDBMException::class);
14+
$this->expectExceptionMessage('Json serialization is only implemented for generated beans.');
15+
$object->jsonSerialize();
16+
}
17+
}

0 commit comments

Comments
 (0)