Skip to content

Commit 3f76382

Browse files
authored
Merge branch '7.x' into forms-disable-search-indexing-by-default
2 parents 6f529c1 + 6ebfbba commit 3f76382

File tree

314 files changed

+6182
-8708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+6182
-8708
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,15 @@
15891589
"contributions": [
15901590
"userTesting"
15911591
]
1592+
},
1593+
{
1594+
"login": "stone-creator",
1595+
"name": "Stone-creator",
1596+
"avatar_url": "https://avatars.githubusercontent.com/u/1327019?v=4",
1597+
"profile": "https://github.com/stone-creator",
1598+
"contributions": [
1599+
"userTesting"
1600+
]
15921601
}
15931602
],
15941603
"contributorsPerLine": 7,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
mode: 'agent'
3+
tools: ['testFailure', 'usages']
4+
description: 'Generate a functional test for highlighted code'
5+
---
6+
Generate a new or update an existing functional test for the highlighted code. The test should cover the following aspects:
7+
8+
A good test should be:
9+
- **Isolated**: It should not depend on other tests or external systems.
10+
- **Fast**: It should run quickly to allow for rapid feedback during development.
11+
- **Deterministic**: It should produce the same result every time it runs, regardless of the environment.
12+
- **Readable**: It should be easy to understand and maintain.
13+
- **Descriptive**: It should clearly indicate what it is testing and why.
14+
- **Comprehensive**: It should cover a wide range of scenarios, including edge cases.
15+
- **Independent**: It should not rely on the state of the application or database, ensuring that it can run in any order without affecting other tests.
16+
- **Behavior-focused**: It should test output for specific input rather than internal implementation, except when verifying performance-critical operations like expensive method calls.
17+
18+
Good practices:
19+
- Never mock objects that have no PHP service dependencies like event or entity classes. Use the real object instead.
20+
- The best way to write a functional test is to use the actual endpoint. Either call a route or a command. The next best thing is to call a subscriber via EventDispatcher. If that is still too broad call a service.
21+
- Make all new classes final by default. Including tests.
22+
- Provide property, param and return types. If not possible to use native types you can always specify the types in the docblock. Mautic uses PHPSTAN so be sure to add types so the PHPSTAN won't fail.
23+
- Use `$this->assertResponseIsSuccessful();` to assert successful requests.
24+
- Use PHPUNIT's data providers to test multiple scenarios in a single test method.
25+
26+
Suggestions for AI:
27+
- Do not modify the production code unless requested. Always just modify the test code.
28+
- Make the simplest test possible. The human will suggest improvements if needed.
29+
30+
You can take an inspiration of existing functional tests. They all extend the `MysqlFunctionalTestCase` class and are located in the `app/bundles/*Bundle/Tests` or `plugins/*Bundle/Tests` directory. The tests are written in PHPUNIT. You can read the version in the `composer.json` file.
31+
32+
To execute a test you have to run it in DDEV. Example: `ddev exec composer test app/bundles/ExampleBundle/tests/ExampleTest.php`.

.github/workflows/transifex.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ permissions:
1313

1414
jobs:
1515
push-to-transifex:
16-
if: github.repository == 'mautic/mautic'
16+
# Run only in the 'mautic/mautic' repository and on the default branch (or manually triggered via UI)
17+
if: github.repository == 'mautic/mautic' && (github.ref_name == github.event.repository.default_branch || github.event_name == 'workflow_dispatch')
1718
name: Push translations to Transifex
1819
runs-on: ubuntu-latest
1920

2021
steps:
21-
- uses: actions/checkout@v4
22+
- name: Checkout
23+
uses: actions/checkout@v4
2224

23-
- name: Setup PHP, with composer and extensions
25+
- name: Setup PHP with extensions
2426
uses: shivammathur/setup-php@v2
2527
with:
2628
php-version: 8.3
2729
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql
2830

29-
- name: Install dependencies
31+
- name: Install Composer dependencies
3032
uses: "ramsey/composer-install@v3"
3133

3234
- name: Push translations to Transifex

.htaccess

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999

100100
# Apache 2.4+
101101
<IfModule authz_core_module>
102+
# Deny access via HTTP requests to all .env files.
103+
<FilesMatch "^\.env.*$">
104+
Require all denied
105+
</FilesMatch>
106+
102107
# Deny access via HTTP requests to all PHP files.
103108
<FilesMatch "\.php$">
104109
Require all denied
@@ -117,6 +122,12 @@
117122

118123
# Fallback for Apache < 2.4
119124
<IfModule !authz_core_module>
125+
# Deny access via HTTP requests to all .env files.
126+
<FilesMatch "^\.env.*$">
127+
Order deny,allow
128+
Deny from all
129+
</FilesMatch>
130+
120131
# Deny access via HTTP requests to all PHP files.
121132
<FilesMatch "\.php$">
122133
Order deny,allow

.php-cs-fixer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
->in(__DIR__.'/plugins')
1212
->in(__DIR__.'/.github/workflows/mautic-asset-upload')
1313
->append([
14-
__DIR__.'/app/AppCache.php',
1514
__DIR__.'/app/AppKernel.php',
1615
__DIR__.'/app/AppTestKernel.php',
1716
__DIR__.'/rector.php',

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
348348
<td align="center" valign="top" width="14.28%"><a href="https://github.com/PedroLoureiro1"><img src="https://avatars.githubusercontent.com/u/116733776?v=4?s=100" width="100px;" alt="PedroLoureiro1"/><br /><sub><b>PedroLoureiro1</b></sub></a><br /><a href="https://github.com/mautic/mautic/commits?author=PedroLoureiro1" title="Code">💻</a></td>
349349
<td align="center" valign="top" width="14.28%"><a href="https://github.com/OlgaMarchuk"><img src="https://avatars.githubusercontent.com/u/219189660?v=4?s=100" width="100px;" alt="OlgaMarchuk"/><br /><sub><b>OlgaMarchuk</b></sub></a><br /><a href="#userTesting-OlgaMarchuk" title="User Testing">📓</a></td>
350350
</tr>
351+
<tr>
352+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/stone-creator"><img src="https://avatars.githubusercontent.com/u/1327019?v=4?s=100" width="100px;" alt="Stone-creator"/><br /><sub><b>Stone-creator</b></sub></a><br /><a href="#userTesting-stone-creator" title="User Testing">📓</a></td>
353+
</tr>
351354
</tbody>
352355
</table>
353356

UPGRADE-7.0.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,36 @@
1212
## Removed code
1313

1414
- Deprecated class `Mautic\MessengerBundle\MessageHandler\TestHandler` removed with no replacement.
15+
- Deprecated class `Mautic\CoreBundle\Factory\MauticFactory` removed. Use dependency injection instead.
16+
- Deprecated class `Mautic\CampaignBundle\Service\Campaign` removed with no replacement.
17+
- Deprecated class `Mautic\CampaignBundle\Form\Type\CampaignEventLeadChangeType` removed with no replacement.
18+
- Deprecated class `Mautic\CoreBundle\Event\CustomFormEvent` removed with no replacement.
19+
- Deprecated class `Mautic\CoreBundle\Helper\UTF8Helper` removed with no replacement.
20+
- Deprecated class `Mautic\CoreBundle\Test\MauticSqliteTestCase` removed with no replacement.
21+
- Deprecated class `Mautic\CoreBundle\Twig\Extension\EmojiExtension` removed with no replacement.
22+
- Deprecated class `Mautic\EmailBundle\Form\Type\AbTestPropertiesType` removed with no replacement.
23+
- Deprecated class `Mautic\EmailBundle\Helper\RequestStorageHelper` removed with no replacement.
24+
- Deprecated class `Mautic\FormBundle\Tests\FormTestAbstract` removed with no replacement.
25+
- Deprecated class `Mautic\LeadBundle\Helper\PointEventHelper` removed with no replacement.
26+
- Deprecated class `Mautic\MarketplaceBundle\Exception\InstallException` removed with no replacement.
27+
- Deprecated class `Mautic\NotificationBundle\Event\NotificationClickEvent` removed with no replacement.
28+
- Deprecated class `Mautic\NotificationBundle\Event\SendingNotificationEvent` removed with no replacement.
29+
- Deprecated class `Mautic\NotificationBundle\Form\Type\ConfigType` removed with no replacement.
30+
- Deprecated class `Mautic\SmsBundle\Api\AbstractSmsApi` removed with no replacement.
31+
- Deprecated class `Mautic\SmsBundle\Api\TwilioApi` removed with no replacement.
32+
- Deprecated interface `Mautic\IntegrationsBundle\Auth\Provider\Oauth2ThreeLegged\AuthorizatorInterface` removed. Use `Mautic\IntegrationsBundle\Integration\Interfaces\AuthenticationInterface` instead.
33+
- Deprecated interface `Mautic\IntegrationsBundle\Auth\Provider\Oauth2ThreeLegged\CredentialsInterface` removed. Use `Mautic\IntegrationsBundle\Auth\Provider\AuthCredentialsInterface` instead.
34+
- Deprecated class `Mautic\IntegrationsBundle\Auth\Provider\Oauth2ThreeLegged\AbstractClientFactory` removed with no replacement.
35+
- Deprecated trait `Mautic\IntegrationsBundle\Integration\BC\BcIntegrationSettingsTrait` removed with no replacement.
36+
- Deprecated exception classes `Mautic\CampaignBundle\Executioner\Scheduler\Exception\ExecutionProhibitedException` and `NotTimeYetException` removed with no replacement.
37+
- Deprecated form data transformers removed:
38+
- `Mautic\CoreBundle\Form\DataTransformer\DatetimeToStringTransformer`
39+
- `Mautic\CoreBundle\Form\DataTransformer\EmojiToHtmlTransformer`
40+
- `Mautic\CoreBundle\Form\DataTransformer\NullToEmptyTransformer`
41+
- Deprecated plugin classes removed:
42+
- `MauticFullContactBundle\Services\FullContact_API`
43+
- `MauticSocialBundle\Form\Type\TwitterCustomType`
44+
- File `app/AppCache.php` removed as it was no longer used.
1545

1646
## Removed Composer dependencies
1747
- `symfony/yaml` see https://github.com/mautic/mautic/pull/14850
@@ -21,12 +51,14 @@
2151
- `noxlogic/ratelimit-bundle` see https://github.com/mautic/mautic/pull/14876
2252
- `symfony/amqp-messenger` see https://github.com/mautic/mautic/pull/14883
2353
- `php-amqplib/rabbitmq-bundle` see https://github.com/mautic/mautic/pull/14883
54+
- `bandwidth-throttle/token-bucket` see https://github.com/mautic/mautic/pull/15271
2455

2556
## BC breaks in the code
2657

2758
### PHP
2859
- Removed `Mautic\DashboardBundle\Dashboard\Widget::FORMAT_MYSQL` constant. Use `DateTimeHelper::FORMAT_DB_DATE_ONLY` instead.
2960
- Removed `Mautic\ApiBundle\Security\OAuth2\Firewall::OAuthListener` class as it was empty. Use `FOS\OAuthServerBundle\Security\Firewall\OAuthListener` instead.
61+
- Removed `Mautic\LeadBundle\Segment\Query\Filter\SegmentReferenceFilterQueryBuilder` as unused.
3062

3163
### Javascript
3264
- Removed `Mautic.insertTextInEditor` function. Use `Mautic.insertHtmlInEditor` instead.

app/AppCache.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/assets/scaffold/files/htaccess

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999

100100
# Apache 2.4+
101101
<IfModule authz_core_module>
102+
# Deny access via HTTP requests to all .env files.
103+
<FilesMatch "^\.env.*$">
104+
Require all denied
105+
</FilesMatch>
106+
102107
# Deny access via HTTP requests to all PHP files.
103108
<FilesMatch "\.php$">
104109
Require all denied
@@ -117,6 +122,12 @@
117122

118123
# Fallback for Apache < 2.4
119124
<IfModule !authz_core_module>
125+
# Deny access via HTTP requests to all .env files.
126+
<FilesMatch "^\.env.*$">
127+
Order deny,allow
128+
Deny from all
129+
</FilesMatch>
130+
120131
# Deny access via HTTP requests to all PHP files.
121132
<FilesMatch "\.php$">
122133
Order deny,allow

app/assets/scaffold/files/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)