Skip to content

Commit 6251162

Browse files
committed
More new methods
1 parent 7f51697 commit 6251162

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/File/Path/Basepath/DefaultTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function basepath()
2929

3030
$replacements = [
3131
'{primaryKey}' => $this->entity->get($this->table->getPrimaryKey()),
32-
'{model}' => $this->table->alias(),
33-
'{table}' => $this->table->table(),
32+
'{model}' => $this->table->getAlias(),
33+
'{table}' => $this->table->getTable(),
3434
'{field}' => $this->field,
3535
'{year}' => date("Y"),
3636
'{month}' => date("m"),

tests/TestCase/File/Path/Basepath/DefaultTraitTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testNoSpecialConfiguration()
1717
$mock->data = ['name' => 'filename'];
1818
$mock->field = 'field';
1919
$mock->entity->expects($this->once())->method('get')->will($this->returnValue(1));
20-
$mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
20+
$mock->table->expects($this->once())->method('getAlias')->will($this->returnValue('Table'));
2121
$mock->table->expects($this->once())->method('getPrimaryKey')->will($this->returnValue('id'));
2222
$this->assertEquals('webroot/files/Table/field/', $mock->basepath());
2323
}
@@ -31,7 +31,7 @@ public function testCustomPath()
3131
$mock->data = ['name' => 'filename'];
3232
$mock->field = 'field';
3333
$mock->entity->expects($this->once())->method('get')->will($this->returnValue(1));
34-
$mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
34+
$mock->table->expects($this->once())->method('getAlias')->will($this->returnValue('Table'));
3535
$mock->table->expects($this->once())->method('getPrimaryKey')->will($this->returnValue('id'));
3636
$this->assertEquals('webroot/files/Table-field/', $mock->basepath());
3737
}
@@ -45,7 +45,7 @@ public function testExistingEntityWithPrimaryKey()
4545
$mock->data = ['name' => 'filename'];
4646
$mock->field = 'field';
4747
$mock->entity->expects($this->once())->method('get')->will($this->returnValue(1));
48-
$mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
48+
$mock->table->expects($this->once())->method('getAlias')->will($this->returnValue('Table'));
4949
$mock->table->expects($this->exactly(2))->method('getPrimaryKey')->will($this->returnValue('id'));
5050
$this->assertEquals('webroot/files/Table-field/1/', $mock->basepath());
5151
}
@@ -113,7 +113,7 @@ public function testModelFieldYearWithMonthAndDayPath()
113113
$mock->data = ['name' => 'filename'];
114114
$mock->field = 'field';
115115
$mock->entity->expects($this->once())->method('get')->will($this->returnValue(1));
116-
$mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
116+
$mock->table->expects($this->once())->method('getAlias')->will($this->returnValue('Table'));
117117

118118
$this->assertEquals('webroot/files/Table/field/' . date("Y") . '/' . date("m") . '/' . date("d") . '/', $mock->basepath());
119119
}
@@ -169,7 +169,7 @@ public function testFieldValue()
169169
$mock->data = ['name' => 'filename'];
170170
$mock->field = 'field';
171171
$mock->entity->expects($this->any())->method('get')->will($this->returnValue('value'));
172-
$mock->table->expects($this->once())->method('alias')->will($this->returnValue('Table'));
172+
$mock->table->expects($this->once())->method('getAlias')->will($this->returnValue('Table'));
173173
$this->assertEquals('webroot/files/Table/value/', $mock->basepath());
174174
}
175175
}

0 commit comments

Comments
 (0)