-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sweep: PHPUnit tests failed. #278
Labels
Comments
🚀 Here's the PR! #279Search Results
ResponseI'll help fix the syntax errors in both test files.
<?php
namespace Tests\Feature;
// ... existing code ...
public function test_advanced_filtering_with_custom_fields_for_leads()
{
$customField = CustomField::factory()->create([
'name' => 'Budget',
'type' => 'number',
'model_type' => 'lead',
'team_id' => $this->user->currentTeam->id,
]);
$lead1 = Lead::factory()->create([
'custom_fields' => ['Budget' => 10000],
'team_id' => $this->user->currentTeam->id,
]);
$lead2 = Lead::factory()->create([
'custom_fields' => ['Budget' => 5000],
'team_id' => $this->user->currentTeam->id,
]);
$response = $this->actingAs($this->user)->get('/leads?custom_fields[Budget][min]=7000');
$response->assertSee($lead1->contact->name);
$response->assertDontSee($lead2->contact->name);
}
}
<?php
namespace Tests\Feature;
use App\Models\Team;
// ... existing code ... Changes made:
These changes should resolve the PHPUnit syntax errors and allow the tests to run properly. Continue the conversation with Sweep here: https://app.sweep.dev/c/355e5742-c151-4c21-ab8f-77a9e19f65c6. 📖 For more information on how to use Sweep, please read our documentation. Tracking ID: 6ead29a51c
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Details
An error occurred inside PHPUnit.
Message: Unmatched '}'
Location: /var/www/html/laravel/contacts/tests/Feature/CustomFieldsTest.php:182
PHP Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /var/www/html/laravel/contacts/tests/Feature/TeamSubscriptionTest.php on line 5
Fix PHPUnit Test Syntax Errors
Description:
Fix syntax errors in two test files that are causing PHPUnit failures: an unmatched curly brace and an incorrect namespace declaration.
Tasks:
In
tests/Feature/CustomFieldsTest.php
:In
tests/Feature/TeamSubscriptionTest.php
:Test:
The existing test cases will run after fixing these syntax errors:
CustomFieldsTest
(7 test methods)TeamSubscriptionTest
(3 test methods)The text was updated successfully, but these errors were encountered: