Skip to content

Commit 881e529

Browse files
committed
php-upgrade
1 parent 61c6b88 commit 881e529

File tree

8 files changed

+1033
-1095
lines changed

8 files changed

+1033
-1095
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ copy-manifest:
2424
aws s3 cp .manifest.json s3://assets.mailslurp.com/examples/manifest.json
2525

2626
copy-shortcodes:
27-
aws s3 sync shortcodes/ s3://api-spec.mailslurp.com/shortcodes-github
27+
aws s3 cp shortcodes/ s3://api-spec.mailslurp.com/shortcodes-github
2828

2929
copy-screenshots:
30-
aws s3 cp php-laravel-phpunit/tests/Browser/screenshots/ s3://api-spec.mailslurp.com/test-screenshots/examples/php-laravel-phpunit
30+
aws s3 cp -r php-laravel-phpunit/tests/Browser/screenshots/ s3://api-spec.mailslurp.com/test-screenshots/examples/php-laravel-phpunit

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ See developer page for [more guides and documentation](https://www.mailslurp.com
1717
- [dart-email-testing](./dart-email-testing)
1818
- [deno-email-api](./deno-email-api)
1919
- [elixir-phoenix-hound](./elixir-phoenix-hound)
20+
- [firebase-examples](./firebase-examples)
2021
- [flutter-email-test](./flutter-email-test)
2122
- [fsharp-email-mstest](./fsharp-email-mstest)
2223
- [golang-email-test](./golang-email-test)
@@ -64,6 +65,7 @@ See developer page for [more guides and documentation](https://www.mailslurp.com
6465
- [swift-email-smtp-examples](./swift-email-smtp-examples)
6566
- [telnet-imap-sh](./telnet-imap-sh)
6667
- [visualbasic](./visualbasic)
68+
- [wait-for-methods-vitest](./wait-for-methods-vitest)
6769

6870
## Running locally
6971
If you wish to run these examples yourself:

javascript-cypress-mailslurp-plugin/README.md

+45-46
Original file line numberDiff line numberDiff line change
@@ -28,58 +28,57 @@ describe("user sign up test with mailslurp plugin", function () {
2828
})
2929
});
3030
//</gen>
31-
//<gen>cypress_plugin_01
3231
it("01 - can load the demo application", function () {
32+
//<gen>cypress_plugin_01
3333
// get wrapped email address and assert contains a mailslurp email address
3434
expect(this.emailAddress).to.contain("@mailslurp");
3535
// visit the demo application
3636
cy.visit("https://playground.mailslurp.com")
3737
cy.title().should('contain', 'React App');
38+
//</gen>
39+
//<gen>cypress_plugin_02
40+
cy.then(function () {
41+
// click sign up and fill out the form
42+
cy.get("[data-test=sign-in-create-account-link]").click()
43+
// use the email address and a test password
44+
cy.get("[name=email]").type(this.emailAddress).trigger('change');
45+
cy.get("[name=password]").type('test-password').trigger('change');
46+
// click the submit button
47+
cy.get("[data-test=sign-up-create-account-button]").click();
48+
//</gen>
49+
})
50+
//<gen>cypress_plugin_03
51+
cy.then(function () {
52+
// app will send user an email containing a code, use mailslurp to wait for the latest email
53+
cy.mailslurp()
54+
// use inbox id and a timeout of 30 seconds
55+
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
56+
// extract the confirmation code from the email body
57+
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
58+
// fill out the confirmation form and submit
59+
.then(code => {
60+
cy.get("[name=code]").type(code).trigger('change');
61+
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
62+
})
63+
})
64+
//</gen>
65+
//<gen>cypress_plugin_04
66+
// fill out sign in form
67+
cy.then( function () {
68+
// use the email address and a test password
69+
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
70+
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
71+
// click the submit button
72+
cy.get("[data-test=sign-in-sign-in-button]").click();
73+
});
74+
//</gen>
75+
//<gen>cypress_plugin_05
76+
// can see authorized welcome screen
77+
cy.then(function () {
78+
// click sign up and fill out the form
79+
cy.get("h1").should("contain", "Welcome");
80+
})
81+
//</gen>
3882
});
39-
//</gen>
40-
//<gen>cypress_plugin_02
41-
// use function instead of arrow syntax to access aliased values on this
42-
it("02 - can sign up using email address", function () {
43-
// click sign up and fill out the form
44-
cy.get("[data-test=sign-in-create-account-link]").click()
45-
// use the email address and a test password
46-
cy.get("[name=email]").type(this.emailAddress).trigger('change');
47-
cy.get("[name=password]").type('test-password').trigger('change');
48-
// click the submit button
49-
cy.get("[data-test=sign-up-create-account-button]").click();
50-
});
51-
//</gen>
52-
//<gen>cypress_plugin_03
53-
it("03 - can receive confirmation code by email", function () {
54-
// app will send user an email containing a code, use mailslurp to wait for the latest email
55-
cy.mailslurp()
56-
// use inbox id and a timeout of 30 seconds
57-
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
58-
// extract the confirmation code from the email body
59-
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
60-
// fill out the confirmation form and submit
61-
.then(code => {
62-
cy.get("[name=code]").type(code).trigger('change');
63-
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
64-
})
65-
});
66-
//</gen>
67-
//<gen>cypress_plugin_04
68-
// fill out sign in form
69-
it("04 - can sign in with confirmed account", function () {
70-
// use the email address and a test password
71-
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
72-
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
73-
// click the submit button
74-
cy.get("[data-test=sign-in-sign-in-button]").click();
75-
});
76-
//</gen>
77-
//<gen>cypress_plugin_05
78-
// can see authorized welcome screen
79-
it("05 - can see welcome screen", function () {
80-
// click sign up and fill out the form
81-
cy.get("h1").should("contain", "Welcome");
82-
});
83-
//</gen>
8483
});
8584
```

javascript-cypress-sms-testing/README.md

+45-46
Original file line numberDiff line numberDiff line change
@@ -28,58 +28,57 @@ describe("user sign up test with mailslurp plugin", function () {
2828
})
2929
});
3030
//</gen>
31-
//<gen>cypress_plugin_01
3231
it("01 - can load the demo application", function () {
32+
//<gen>cypress_plugin_01
3333
// get wrapped email address and assert contains a mailslurp email address
3434
expect(this.emailAddress).to.contain("@mailslurp");
3535
// visit the demo application
3636
cy.visit("https://playground.mailslurp.com")
3737
cy.title().should('contain', 'React App');
38+
//</gen>
39+
//<gen>cypress_plugin_02
40+
cy.then(function () {
41+
// click sign up and fill out the form
42+
cy.get("[data-test=sign-in-create-account-link]").click()
43+
// use the email address and a test password
44+
cy.get("[name=email]").type(this.emailAddress).trigger('change');
45+
cy.get("[name=password]").type('test-password').trigger('change');
46+
// click the submit button
47+
cy.get("[data-test=sign-up-create-account-button]").click();
48+
//</gen>
49+
})
50+
//<gen>cypress_plugin_03
51+
cy.then(function () {
52+
// app will send user an email containing a code, use mailslurp to wait for the latest email
53+
cy.mailslurp()
54+
// use inbox id and a timeout of 30 seconds
55+
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
56+
// extract the confirmation code from the email body
57+
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
58+
// fill out the confirmation form and submit
59+
.then(code => {
60+
cy.get("[name=code]").type(code).trigger('change');
61+
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
62+
})
63+
})
64+
//</gen>
65+
//<gen>cypress_plugin_04
66+
// fill out sign in form
67+
cy.then( function () {
68+
// use the email address and a test password
69+
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
70+
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
71+
// click the submit button
72+
cy.get("[data-test=sign-in-sign-in-button]").click();
73+
});
74+
//</gen>
75+
//<gen>cypress_plugin_05
76+
// can see authorized welcome screen
77+
cy.then(function () {
78+
// click sign up and fill out the form
79+
cy.get("h1").should("contain", "Welcome");
80+
})
81+
//</gen>
3882
});
39-
//</gen>
40-
//<gen>cypress_plugin_02
41-
// use function instead of arrow syntax to access aliased values on this
42-
it("02 - can sign up using email address", function () {
43-
// click sign up and fill out the form
44-
cy.get("[data-test=sign-in-create-account-link]").click()
45-
// use the email address and a test password
46-
cy.get("[name=email]").type(this.emailAddress).trigger('change');
47-
cy.get("[name=password]").type('test-password').trigger('change');
48-
// click the submit button
49-
cy.get("[data-test=sign-up-create-account-button]").click();
50-
});
51-
//</gen>
52-
//<gen>cypress_plugin_03
53-
it("03 - can receive confirmation code by email", function () {
54-
// app will send user an email containing a code, use mailslurp to wait for the latest email
55-
cy.mailslurp()
56-
// use inbox id and a timeout of 30 seconds
57-
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
58-
// extract the confirmation code from the email body
59-
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
60-
// fill out the confirmation form and submit
61-
.then(code => {
62-
cy.get("[name=code]").type(code).trigger('change');
63-
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
64-
})
65-
});
66-
//</gen>
67-
//<gen>cypress_plugin_04
68-
// fill out sign in form
69-
it("04 - can sign in with confirmed account", function () {
70-
// use the email address and a test password
71-
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
72-
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
73-
// click the submit button
74-
cy.get("[data-test=sign-in-sign-in-button]").click();
75-
});
76-
//</gen>
77-
//<gen>cypress_plugin_05
78-
// can see authorized welcome screen
79-
it("05 - can see welcome screen", function () {
80-
// click sign up and fill out the form
81-
cy.get("h1").should("contain", "Welcome");
82-
});
83-
//</gen>
8483
});
8584
```

php-composer-phpunit/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ install:
1010
php composer.phar install
1111

1212
test:
13-
API_KEY=$(API_KEY) ./vendor/bin/phpunit test
13+
API_KEY=$(API_KEY) ./vendor/bin/phpunit test.php
1414

1515
test-ci: composer install test

php-composer-phpunit/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
],
88
"require": {
99
"mailslurp/mailslurp-client-php": "dev-master",
10-
"phpunit/phpunit": "^8"
10+
"phpunit/phpunit": "^11"
1111
}
1212
}

0 commit comments

Comments
 (0)