public function testExitingEntityWithCompositePrimaryKey()
{
$this->setExpectedException('LogicException', '{primaryKey} substitution not valid for composite primary keys');
$mock = $this->getMockForTrait('Josegonzalez\\Upload\\File\\Path\\Basepath\\DefaultTrait');
$mock->entity = $this->getMock('Cake\\ORM\\Entity');
$mock->table = $this->getMock('Cake\\ORM\\Table');
$mock->settings = ['path' => 'webroot{DS}files{DS}{model}-{field}{DS}{primaryKey}/'];
$mock->data = ['name' => 'filename'];
$mock->field = 'field';
$mock->entity->expects($this->once())->method('isNew')->will($this->returnValue(false));
$mock->table->expects($this->once())->method('primaryKey')->will($this->returnValue(['id', 'other_id']));
$mock->basepath();
}