<commit_before><?php

use Core\Models\Subscription;

/***
 * Class SubscriptionsResourceTest.
 */
class SubscriptionsResourceTest extends IntegrationApiV1TestCase
{
    protected $resourceName = 'subscriptions';

    protected $resourceStructure = [
        'email',
        'token',
    ];

    public function testCreateSuccess()
    {
        $email = $this->fake()->email;

        $responce = $this
            ->json('POST', sprintf('/%s', $this->resourceName), [
                'email' => $email,
            ])
            ->assertStatus(201)
            ->assertJsonStructure($this->resourceStructure)
            ->assertJson([
                'email' => $email,
            ]);
    }

    public function testDeleteSuccess()
    {
        $subscription = factory(Subscription::class)->create();

        $responce = $this
            ->json('DELETE', sprintf('/%s/%s', $this->resourceName, $subscription->token))
            ->assertStatus(204);
    }
}
<commit_msg>[BE]. Fixed subscriptions resource integration tests<commit_after><?php

use Core\Models\Subscription;

/**
 * Class SubscriptionsResourceTest.
 */
class SubscriptionsResourceTest extends IntegrationApiV1TestCase
{
    protected $resourceName = 'subscriptions';

    protected $resourceStructure = [
        'email',
        'token',
    ];

    public function testCreateSuccess()
    {
        $email = $this->fake()->email;

        $responce = $this
            ->json('POST', sprintf('/%s', $this->resourceName), [
                'email' => $email,
            ])
            ->assertStatus(201)
            ->assertJsonStructure($this->resourceStructure)
            ->assertJson([
                'email' => $email,
            ]);
    }

    public function testDeleteSuccess()
    {
        $subscription = factory(Subscription::class)->create();

        $responce = $this
            ->json('DELETE', sprintf('/%s/%s', $this->resourceName, $subscription->token))
            ->assertStatus(204);
    }
}

{'fraction_non_alphanumeric': 0.14844533600802406, 'fraction_numerical': 0.007021063189568706, 'mean_word_length': 2.192, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '416366', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 95}