-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnderscorePluralNamingStrategyTest.php
73 lines (63 loc) · 1.88 KB
/
UnderscorePluralNamingStrategyTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
declare(strict_types=1);
/*
* This is part of the webuni/doctrine-extensions package.
*
* (c) Martin Hasoň <[email protected]>
* (c) Webuni s.r.o. <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Webuni\DoctrineExtension\Tests;
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
use Webuni\DoctrineExtensions\Mapping\PluralNamingStrategy;
final class UnderscorePluralNamingStrategyTest extends AbstractPluralNamingStrategyTest
{
protected function setUp(): void
{
$this->strategy = new PluralNamingStrategy(new UnderscoreNamingStrategy());
}
public function getClassToTableName()
{
return [
['My\User', 'users'],
['My\Group', 'groups'],
['My\Man', 'men'],
['My\Person', 'people'],
['My\UserGroup', 'user_groups'],
];
}
public function getPropertyToColumnName()
{
return [
['My\User', 'name', 'name'],
['My\Group', 'title', 'title'],
['My\Man', 'birthday', 'birthday'],
['My\Person', 'groups', 'groups'],
['My\UserGroup', 'users', 'users'],
[null, 'users', 'users'],
];
}
public function getEmbeddedFieldToColumnName()
{
return [
[null, null, 'address', null, 'address_'],
['My\User', 'My\Address', 'address', 'city', 'address_city'],
];
}
public function getJoinTableName()
{
return [
['My\User', 'My\Group', 'groups', 'users_groups'],
['My\User', 'My\Group', null, 'users_groups'],
];
}
public function getJoinKeyColumnName()
{
return [
['My\User', 'address', 'users_address'],
['My\Person', null, 'people_id'],
];
}
}