Resource icon

Beta Seeder: test data generator 1.0.0 beta 15

No permission to download
1.0.0 Beta 15 declares Faker's catchPhrase() and bs() in the PHPStan stub.

Nothing else has changed, and nothing changes in the database: upload the files and upgrade as usual.

Fixed​

  • phpstan/faker.stub did not declare catchPhrase() or bs(), so a seeder calling $faker->catchPhrase() was method.notFound from level 2. Both are now declared, returning string. Only Faker's en_US company provider has them: they work under Seeder's default locale, en_AU, which falls back to it, but a locale with its own company provider - en_GB and de_DE among them - lacks them, and the call then throws. A seeder meant to run under any locale should use company() or sentence() instead.
1.0.0 Beta 14 types Faker's words(), sentences() and paragraphs() as a string in the PHPStan stub when they are asked for text.

Nothing else has changed, and nothing changes in the database: upload the files and upgrade as usual.

Fixed​


  • phpstan/faker.stub typed words(), sentences() and paragraphs() as a list or a string whatever they were asked for, so passing $faker->words(2, true) where a string is expected, as in ucwords(), was an error from level 7. A call with $asText set to true is now typed string, and one without it list<string>.
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.

New​

  • 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.

Fixed​

  • 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.

Worth knowing​

  • 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.

New​

  • 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.

Changed​

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

Fixed​

  • 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.

Worth knowing​

  • 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.
1.0.0 Beta 10 can have members register through XenForo's own registration service, so another add-on's reaction to a registration happens for them.

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

New​

  • Registration through XenForo's service. seeder:run User -p registered=1, or UserFactory::registered(), saves each member through XenForo's registration service, so an add-on that extends it - to record the browser or the country a member signed up from, say - does so for seeded members as well. XenForo itself mails and alerts nobody: its mail, welcome message and trophies are off for the save. The forum's registration setup decides whether a member is valid or awaiting confirmation or approval, unless moderated() or unconfirmed() says which, and a member the forum's options ask a date of birth or a location of is given one.
  • The request a registration arrives on. registered(['REMOTE_ADDR' => '203.0.113.7', 'HTTP_CF_IPCOUNTRY' => 'AU']) sets the address and headers XenForo's request carries during the save. Context::withRequest() does the same for any code of your own, and puts the real request back afterwards, even when that code throws.

Worth knowing​

  • registered=1 runs whatever other add-ons do on a registration, which can include sending the member's details out of the forum. The seeder says so before it starts.
  • It is not in seeder:validate's sample, for that reason.
  • XenForo's spam check is not run: the registration form runs it, not the service.
  • The approval queue shows the address from the member's registration in the IP log, which is where a registered member's address goes.
  • Beta 9 given registered=1 makes the members the ordinary way, lists the parameter as ignored and exits with 1. The README marks both additions since 1.0.0b10.
1.0.0 Beta 9 seeds profile posts, and can have every member given to a poll vote in it.

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

New​

  • Profile posts. seeder:run ProfilePost, or ProfilePostFactory and ProfilePostCommentFactory, write messages one member leaves on another's profile, status updates, and comments on both. They go through XenForo's own profile post and comment creators, so comment counts, dates and latest comments are as a forum leaves them, and each appears in the news feed. Nobody is alerted - not the profile's owner, not the author, not anyone mentioned - and no address is logged.
  • A poll every member votes in. ThreadFactory::votedByAll() has every member given to recycle() vote once, rather than a random number of them, for a check that needs to know exactly who voted: ->recycle($voters)->withPoll(4)->votedByAll().

Worth knowing​

  • A profile post is by someone other than the profile's owner unless status() says otherwise.
  • Profile posts are in seeder:validate's sample. The default seeder does not make them; run ProfilePost after it.
  • ProfilePost given to Beta 8 is refused as an unknown seeder. The README marks both additions since 1.0.0b9.
1.0.0 Beta 8 seeds the job queue: weeks of failed jobs, and jobs waiting that will never run.

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

New​

  • Failed jobs. seeder:run Job, or FailedJobFactory, writes the history XenForo 2.3 keeps when a job throws: a few faults that recur and many one-offs, thrown from XenForo's code and the libraries it ships, from an add-on and the libraries it ships, from outside the forum, and with no file at all. A fault inside the forum names a real file where there is one. Some messages quote a credential, every one made up and marked SECRET or example.com, for testing whatever displays these to remove them. None is dated within a day of now.
  • Jobs in the queue, with JobFactory: some to be run by hand, some tried and waiting to try again. None will ever run. Each is due five to ten years from now and names a job class that does not exist, so a seeded queue has nothing due or stalled.

Worth knowing​

  • Neither is in seeder:validate's sample or the default seeder, like the error log.
  • XenForo has no entity for either table, so seeder:list names them xf_failed_job and xf_job.
  • Job given to Beta 7 is refused as an unknown seeder. The README marks it since 1.0.0b8.
1.0.0 Beta 7 can offer seeded user upgrades for sale, and says so when a factory is used where nothing records what it makes.

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

New​

  • User upgrades offered for sale. UserUpgradeFactory::new()->purchasable(), or -p purchasable=N on the UserUpgrade seeder, lists an upgrade among those members can buy, with its purchase button. It still cannot be bought: the payment profile it names is switched off, and XenForo refuses a purchase through it before writing anything. The seeder says so before it starts.
  • A warning for a factory used outside seeder:run. Called from a script or a shell, a factory records nothing, so what it makes is in no batch and seeder:clean cannot remove it. The first thing a process makes that way is now named in the server error log and on standard error. Inside a database transaction - a test that rolls its work back - nothing is said. On XenForo 2.3.0 only standard error carries it: XenForo's own error logging cannot write from a script there.

Worth knowing​

  • The README said a seeded upgrade could not be bought because can_purchase was off. It is the switched-off payment profile that stops a purchase; can_purchase only decides whether the upgrade is offered.
  • XenForo shows a guest every upgrade as available, whatever can_purchase says, and a command-line script that sets no visitor is a guest. Check the list as a member.
  • A parameter from this release given to Beta 6 is named as ignored and the run exits 1. The README marks each new one since 1.0.0b7.
1.0.0 Beta 6 adds categories and forums inside forums, so a run can build a whole forum tree.

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

New​

  • 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

Fixed​

  • 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.

Worth knowing​

  • 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.
1.0.0 Beta 5 adds permissions on a forum, so seeded members can fall into several permission combinations.

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

New​

  • Permissions on a forum. UserGroupFactory::new()->grantingOn($forum, ['forum' => ['viewOthers' => 'deny']]) gives a user group its own permissions on one forum or other node, as the control panel's node permissions do: content_allow, reset or deny for a flag, a number for a limit. A permission a node cannot have is refused.
  • Members in several permission combinations. permission_groups on the Thread and Default seeders makes that many groups, each denying its members other members' threads in one of the run's forums, and spreads the authors across them. Code that filters content per member - a digest, a feed, a search - needs members who see different things, and until now every seeded member saw the same.

Fixed​

  • A forum parameter naming something that is not a forum made the Thread seeder's authors before refusing. It now refuses before making anything, and says what the node is.

Worth knowing​

  • A seeded member's preferences are the forum's default registration values. XenForo ships receive admin email off there, so code that selects members by it finds no seeded member until one is set with state(['Option.receive_admin_email' => true]). The README now says so.
  • Deleting a user group empties the forum's cached CSS, so cleaning a batch with permission groups does too, as with the user groups in Beta 3.
  • A parameter from this release given to Beta 4 is named as ignored and the run exits 1. The README marks each new one since 1.0.0b5.
Back
Top Bottom