Seeder: test data generator

Seeder: test data generator 1.0.0

Kostenloser Download über tägliche Glücksaufgabe
The classes your own seeders and factories build on - AbstractSeeder, AbstractFactory and AbstractBulkFactory - are now stable: a change that would break a seeder or factory of yours waits for 2.0.

Nothing from Beta 16 has changed its name, and nothing changes in the database: upload the files and upgrade as usual.

  • seeder:run Resource -p guests=2 now says so before it starts when the forum's preRegAction option is off, as it is when XenForo is installed. The ratings held before registering are still made and shown in the approval queue, but with that option off, approving the member deletes the rating and makes nothing. Turn it on (guests may act before registering) for approving to complete them.

  • Cleaning a seeded resource now removes every rating of it, including one Seeder did not make - such as one completed by approving a member, or one added by hand. The Resource Manager would otherwise leave those ratings behind when the resource is deleted.
1.0.0 Beta 13 fixes seeder:clean leaving behind rows written by a bulk factory whose keys are long, and ships a PHPStan stub for the methods Seeder adds to Faker.

Beta 12 was never released here; this replaces it, and the notes below are everything since Beta 11. Nothing has changed its name. The upgrade widens one column of Seeder's own record table: upload the files and upgrade as usual.

  • A PHPStan stub. phpstan/faker.stub declares the methods Seeder adds to Faker, such as crawlerUserAgent() and documentationIp(), which PHPStan otherwise reports as undefined at every level. Every array in it has a value type, so it adds no error at any level. Name it in stubFiles beside Faker's Generator.php in scanFiles; the README has the lines.

  • A row written by a bulk factory whose key was longer than 100 bytes was recorded with its key cut short. seeder:clean then left the row behind and reported it as already gone, and two keys sharing their first 100 bytes were recorded as one. Keys are now recorded whole up to 1,024 bytes, and a longer key stops the run before its row is written. None of Seeder's own seeders were affected; a bulk factory in another add-on, on a table with long text keys, was.

  • A batch recorded by an earlier beta keeps the keys it recorded. If one of yours holds long keys, cleaning it still leaves those rows; delete them by hand.
  • The README said Faker's added methods come back from PHPStan as mixed; they are reported as undefined. An add-on ignoring those errors by name can drop the ignores once it uses the stub.
  • If you took Beta 12 from the repository, its stub left nineteen arrays without a value type, which PHPStan reports from level 6 and will not let you ignore. Beta 13's stub fixes that.
1.0.0 Beta 11 makes moderators with the record XenForo keeps for them, and seeds the spam trigger and email bounce logs.

Nothing from Beta 10 has changed its name, and there is no upgrade step: upload the files and upgrade as usual.

  • Moderators. seeder:run User -p moderators=3, or UserFactory::moderator(), makes super moderators with the moderator record XenForo keeps, so they are on the admin control panel's moderator list. moderator($forum) makes a moderator of that forum alone. Neither is given moderator permissions, as with administrator().
  • The spam trigger log. seeder:run SpamTrigger fills it with registrations and messages XenForo's spam check held for approval or refused, each in XenForo's own words, with the member or post in the state its entry says. A reply refused outright was never saved, so its entry has no content, as XenForo writes it. SpamTriggerLogFactory writes one about any member, thread, reply, profile post, comment or conversation.
  • The email bounce log. seeder:run EmailBounce fills it with hard bounces for members whose mail has stopped, soft bounces, automatic replies, delays and bounces for addresses no member has, each with the delivery report it was read from. EmailBounceLogFactory writes one for any member.
  • A registered member who is valid whatever the forum's setup. UserFactory::valid(), with registered(), gives a valid member on a forum that asks for email confirmation or approval.

  • Every moderator Seeder makes for itself now has the moderator record: whoever bans members, gives warnings or appears in the moderator log.

  • A member given both withTwoStep() and withPasskey() logged a database error, and their passkey was missing from their two-step methods, though the run reported success.
  • A warning made with WarningFactory::expired() and dated in the last second could be saved unexpired.

  • Only the logs are written. Nothing is read from a bounce mailbox, the soft bounce count XenForo acts on is not touched, and nothing that reacts to a bounce as XenForo reads it sees these.
  • XenForo deletes both logs' entries after 30 days, so every seeded entry is dated within the last month - and is gone at the next daily clean-up once that is past, whether or not its batch is cleaned.
  • XenForo keeps one spam trigger log entry for each piece of content, so a second about the same is refused.
  • The spam cleaner log is not seeded: an entry there only makes sense beside a real clean-up.
  • Beta 10 refuses SpamTrigger and EmailBounce as unknown seeders, and given moderators makes the members without moderator rights, lists the parameter as ignored and exits with 1. The README marks every addition since 1.0.0b11.
Nothing from Beta 5 has changed its name or its behaviour, and there is no upgrade step: upload the files and upgrade as usual.

  • Categories. CategoryFactory makes a category, and every forum factory now has in($parent): ForumFactory::new()->in($category), or ->in($forum) for a sub-forum. It takes a node, or the category or forum behind one.
  • A forum tree from a seeder. categories on the Default seeder puts the forums inside that many categories, and subforums gives each forum one or more forums inside it. Threads go into every forum, sub-forums included:
    seeder:run Default -p categories=3 -p forums=6 -p subforums=2

  • A forum given a parent made earlier in the same run was refused with "Please select a valid parent". XenForo works out where a node sits in the tree at the end of a request; Seeder now has it do that as each node is saved, so a run can make a category and the forums inside it one after another.

  • Cleaning removes a tree deepest first. A forum you made yourself inside a seeded category is moved up to the category's parent when the category goes, as XenForo does when a category is deleted.
  • Through Default, permission_groups puts every member it makes in a group, not only the authors: every member Default makes is an author.
  • A parameter from this release given to Beta 5 is named as ignored and the run exits 1. The README marks each new one since 1.0.0b6.
Zurück
Oben