fix some tests
Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
Родитель
36c8db50d0
Коммит
34579344a0
|
@ -1,40 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the comment model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Comment')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'dt' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
},
|
||||
'timestamp' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'comment' => Faker::text(255)
|
||||
]);
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the comment model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Comment')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'timestamp' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'comment' => Faker::text(255),
|
||||
'isNoUser' => 0,
|
||||
'displayName' => Faker::text(255),
|
||||
]);
|
||||
|
|
|
@ -1,34 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the text model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Option')->setDefinitions([
|
||||
'pollOptionText' => Faker::text(255),
|
||||
'timestamp' => 0,
|
||||
'order' => 0,
|
||||
'confirmed' => 0
|
||||
]);
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the text model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Option')->setDefinitions([
|
||||
'owner' => Faker::text(255),
|
||||
'ownerDisplayName' => Faker::text(255),
|
||||
'ownerIsNoUser' => 0,
|
||||
'released' => function () {
|
||||
$date = new DateTime('now');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'pollOptionText' => Faker::text(255),
|
||||
'timestamp' => 0,
|
||||
'order' => 0,
|
||||
'confirmed' => 0,
|
||||
'duration' => 0,
|
||||
]);
|
||||
|
|
|
@ -1,56 +1,62 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the poll model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Poll')->setDefinitions([
|
||||
'type' => 'textPoll',
|
||||
'title' => Faker::text(124),
|
||||
'description' => Faker::text(255),
|
||||
'owner' => Faker::firstNameMale(),
|
||||
'created' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'expire' => function () {
|
||||
$date = new DateTime('tomorrow');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'deleted' => function () {
|
||||
$date = new DateTime('+1 month');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'access' => 'public',
|
||||
'anonymous' => 0,
|
||||
'fullAnonymous' => 0,
|
||||
'allowMaybe' => 1,
|
||||
'options' => '["yes","no","maybe"]',
|
||||
'settings' => '{"someJSON":0}',
|
||||
'voteLimit' => 0,
|
||||
'showResults' => 'always',
|
||||
'adminAccess' => 0,
|
||||
'important' => 0
|
||||
]);
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the poll model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Poll')->setDefinitions([
|
||||
'type' => 'textPoll',
|
||||
'title' => Faker::text(124),
|
||||
'description' => Faker::text(255),
|
||||
'owner' => Faker::firstNameMale(),
|
||||
'created' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'expire' => function () {
|
||||
$date = new DateTime('tomorrow');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'deleted' => function () {
|
||||
$date = new DateTime('+1 month');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'access' => 'public',
|
||||
'anonymous' => 0,
|
||||
'allowComment' => 1,
|
||||
'allowMaybe' => 1,
|
||||
'allowProposals' => 1,
|
||||
'proposalsExpire' => function () {
|
||||
$date = new DateTime('tomorrow');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'voteLimit' => 0,
|
||||
'optionLimit' => 0,
|
||||
'showResults' => 'always',
|
||||
'adminAccess' => 0,
|
||||
'important' => 0,
|
||||
'hideBookedUp' => 0,
|
||||
'useNo' => 0,
|
||||
]);
|
||||
|
|
|
@ -1,33 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the poll model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Share')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'emailAddress' => Faker::safeEmail(),
|
||||
'displayName' => Faker::lastName()
|
||||
]);
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the poll model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Share')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'emailAddress' => Faker::safeEmail(),
|
||||
'invitationSent' => function () {
|
||||
$date = new DateTime('today');
|
||||
return $date->getTimestamp();
|
||||
},
|
||||
'displayName' => Faker::lastName(),
|
||||
'isNoUser' => 0,
|
||||
]);
|
||||
|
|
|
@ -1,33 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the vote model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Vote')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'voteOptionText' => Faker::text(255),
|
||||
'voteAnswer' => 'yes'
|
||||
]);
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
use League\FactoryMuffin\Faker\Facade as Faker;
|
||||
|
||||
/**
|
||||
* General factory for the vote model.
|
||||
*/
|
||||
$fm->define('OCA\Polls\Db\Vote')->setDefinitions([
|
||||
'userId' => Faker::firstNameMale(),
|
||||
'voteOptionText' => Faker::text(255),
|
||||
'voteAnswer' => 'yes',
|
||||
'displayName' => Faker::firstNameMale(),
|
||||
'isNoUser' => 0,
|
||||
]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче