Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

brendt/aggregate.stitcher.io

608 stars
2 code files
View brendt/aggregate.stitcher.io on GitHub

database/factories/SourceFactory.php

Open in GitHub
use Domain\Source\Models\Source;
use Domain\User\Models\User;
 
$factory->define(Source::class, function () {
return [
'user_id' => function () {
return factory(User::class)->create()->id;
},
'is_active' => true,
'website' => faker()->url,
'url' => faker()->url,
];
});

tests/Domain/Post/Models/PostTest.php

Open in GitHub
use Tests\TestCase;
use Domain\Mute\Models\Mute;
use Domain\Post\Models\Post;
use Domain\Source\Models\Source;
 
class PostTest extends TestCase
{
/** @test */
public function muted_source_is_ignored(): void
{
$source = factory(Source::class)->create();
 
factory(Post::class)->create([
'source_id' => $source->id,
]);
 
Mute::make($this->user, $source);
 
$this->assertEquals(0, Post::whereNotMuted($this->user)->count());
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.