Skip to content

Commit 273feae

Browse files
committed
space class for uppercased strings
1 parent c519345 commit 273feae

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Mapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getChanges(): array
133133

134134
public function getClassSpace(int|string $class): int|string
135135
{
136-
if (!is_integer($class) && class_exists($class)) {
136+
if (!is_integer($class) && !ctype_lower($class) && class_exists($class)) {
137137
if (!array_key_exists($class, $this->classNames)) {
138138
$this->registerClass($class);
139139
}

tests/MapperTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ public function testClassBased()
4848
$this->assertEquals($row, $mapper->findOne('constructor'));
4949
}
5050

51+
public function testAttribute()
52+
{
53+
$mapper = $this->createMapper();
54+
$attribute = $mapper->createSpace('attribute');
55+
$attribute->addProperty('key', 'string');
56+
$attribute->addProperty('value', 'string');
57+
$attribute->addIndex(['key']);
58+
59+
$attribute = $mapper->findOrCreate('attribute', ['key' => 'tester']);
60+
$this->assertNotNull($attribute);
61+
}
62+
5163
public function testIdleField()
5264
{
5365
$mapper = $this->createMapper();

0 commit comments

Comments
 (0)