BitmaskedCommentsFixture.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Tools\Test\Fixture;
  3. use Cake\TestSuite\Fixture\TestFixture;
  4. use TestApp\Model\Entity\BitmaskedComment;
  5. /**
  6. * For BitmaskedBehaviorTest
  7. */
  8. class BitmaskedCommentsFixture extends TestFixture {
  9. /**
  10. * Fields property
  11. *
  12. * @var array
  13. */
  14. public array $fields = [
  15. 'id' => ['type' => 'integer'],
  16. 'article_id' => ['type' => 'integer', 'null' => true],
  17. 'user_id' => ['type' => 'integer', 'null' => true],
  18. 'comment' => 'text',
  19. 'status' => ['type' => 'integer', 'null' => false, 'length' => 2, 'default' => 0],
  20. 'created' => 'datetime',
  21. 'updated' => 'datetime',
  22. '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
  23. ];
  24. /**
  25. * Records property
  26. *
  27. * @var array
  28. */
  29. public array $records = [
  30. ['article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'status' => 0, 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'],
  31. ['article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'status' => BitmaskedComment::STATUS_ACTIVE, 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'],
  32. ['article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'status' => BitmaskedComment::STATUS_PUBLISHED, 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'],
  33. ['article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'status' => 3, 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'],
  34. ['article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'status' => BitmaskedComment::STATUS_APPROVED, 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'],
  35. ['article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'status' => 5, 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31'],
  36. ['article_id' => 2, 'user_id' => 3, 'comment' => 'Comment With All Bits set', 'status' => 15, 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31'],
  37. ];
  38. }