mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-19 20:00:20 +02:00
33 lines
610 B
PHP
33 lines
610 B
PHP
<?php
|
|
|
|
require_once dirname(dirname(__FILE__)) . '/setup.php';
|
|
|
|
use AppBundle\Model\Folder;
|
|
|
|
class FolderTest extends BaseTestCase {
|
|
|
|
public function setUp() {
|
|
parent::setUp();
|
|
|
|
Folder::truncate();
|
|
}
|
|
|
|
public function testNewFolderBecomesDefault() {
|
|
$f1 = new Folder();
|
|
$f1->is_default = true;
|
|
$f1->owner_id = TestUtils::userId();
|
|
$f1->save();
|
|
|
|
$f2 = new Folder();
|
|
$f2->is_default = true;
|
|
$f2->owner_id = TestUtils::userId();
|
|
$f2->save();
|
|
|
|
$f1 = Folder::find($f1->id);
|
|
$f2 = Folder::find($f2->id);
|
|
|
|
$this->assertTrue(!$f1->is_default);
|
|
$this->assertTrue(!!$f2->is_default);
|
|
}
|
|
|
|
} |