diff options
author | René Gieling <github@dartcafe.de> | 2021-01-02 02:48:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 02:48:46 +0300 |
commit | 4729f28c4c1afd48fd8083f4ccd6f6055873a326 (patch) | |
tree | 79b987a460387ee46c6331a7ea8fe7a6ab43e88d /tests | |
parent | a90dd386b855d21d18e9734df7d7a13ed35dfa0b (diff) |
Avoid duplicate entries via unique index in certain dbs (#1284)
Squashing due to many commits
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Unit/Db/OptionMapperTest.php | 6 | ||||
-rw-r--r-- | tests/Unit/Factories/LogFactory.php | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/Unit/Db/OptionMapperTest.php b/tests/Unit/Db/OptionMapperTest.php index 9fce8b18..9957b6c1 100644 --- a/tests/Unit/Db/OptionMapperTest.php +++ b/tests/Unit/Db/OptionMapperTest.php @@ -24,6 +24,9 @@ namespace OCA\Polls\Db; use League\FactoryMuffin\Faker\Facade as Faker; + +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; + use OCP\IDBConnection; use OCA\Polls\Tests\Unit\UnitTestCase; @@ -97,8 +100,9 @@ class OptionMapperTest extends UnitTestCase { * includes testFind */ public function testUpdate() { + $i = 0; foreach ($this->options as &$option) { - $option->setPollOptionText('Changed option'); + $option->setPollOptionText('Changed option' . ++$i); $this->assertInstanceOf(Option::class, $this->optionMapper->update($option)); } } diff --git a/tests/Unit/Factories/LogFactory.php b/tests/Unit/Factories/LogFactory.php index 779d390c..9d0c206e 100644 --- a/tests/Unit/Factories/LogFactory.php +++ b/tests/Unit/Factories/LogFactory.php @@ -35,5 +35,5 @@ $fm->define('OCA\Polls\Db\Log')->setDefinitions([ 'userId' => Faker::firstNameMale(), 'displayName' => Faker::lastName(), 'messageId' => 'addPoll', - 'message' => Faker::text(255) + 'message' => Faker::text(128) ]); |