<commit_before><?php
namespace Suyabay\Tests;
use Auth;
use Suyabay\User;
use Suyabay\Role;
use Suyabay\Channel;
use Suyabay\Episode;
use Suyabay\Comment;
use Suyabay\Password_reset;
trait CreateData
{
    /**
     * Create test user sample data
     */
    public function createUser($role)
    {
        return User::create([
            'id'         => 1,
            'username'   => 'test',
            'email'      => '<EMAIL>',
            'password'   => bcrypt('<PASSWORD>'),
            'facebookID' => 0,
            'twitterID'  => 0,
            'role_id'    => $role,
            'avatar'     => 'image',
            'active'     => 1
        ]);
    }
    /**
     * Create Password-reset test sample data
     */
    public function createPasswordResetUser()
    {
        return Password_reset::create([
            'email' => '<EMAIL>',
            'token' => <PASSWORD>
        ]);
    }
    /**
     * Create channel test sample data
     */
    public function createChannel()
    {
        return Channel::create([
            'id'                   => 1,
            'channel_name'         => 'Channel name',
            'channel_description'  => 'Channel description',
            'user_id'              => 1,
            'subscription_count'   => 0
        ]);
    }
    /**
     * Create Episode test sample data
     */
    public function createEpisode()
    {
        return Episode::create([
            'episode_name'          => 'Episode name',
            'episode_description'   => 'Episode description',
            'channel_id'            => 1,
            'view_count'            => 0,
            'status'                => 1,
            'image'                 => 'dummy url',
            'audio_mp3'             => 'dummy url'
        ]);
    }
    /**
     * Create Comment test sample data
     */
    public function createComment()
    {
        return Comment::create([
            'user_id'    => 1,
            'episode_id' => 1,
            'comments'   => 'The new comment'
        ]);
    }
    /**
     * User login function
     */
    public function login()
    {   
        $user = $this->createUser(3);
        $this->createChannel();
        $this->createEpisode();
        return Auth::attempt(['username' => 'test', 'password' => '<PASSWORD>']);
    }
}<commit_msg>[hotfix][#112876091] Fix  PSR-4 setting for linespace after php opening tag, namespace and use declarations<commit_after><?php

namespace Suyabay\Tests;

use Auth;
use Suyabay\User;
use Suyabay\Role;
use Suyabay\Channel;
use Suyabay\Episode;
use Suyabay\Comment;
use Suyabay\Password_reset;

trait CreateData
{
    /**
     * Create test user sample data
     */
    public function createUser($role)
    {
        return User::create([
            'id'         => 1,
            'username'   => 'test',
            'email'      => '<EMAIL>',
            'password'   => bcrypt('<PASSWORD>'),
            'facebookID' => 0,
            'twitterID'  => 0,
            'role_id'    => $role,
            'avatar'     => 'image',
            'active'     => 1
        ]);
    }
    /**
     * Create Password-reset test sample data
     */
    public function createPasswordResetUser()
    {
        return Password_reset::create([
            'email' => '<EMAIL>',
            'token' => <PASSWORD>
        ]);
    }
    /**
     * Create channel test sample data
     */
    public function createChannel()
    {
        return Channel::create([
            'id'                   => 1,
            'channel_name'         => 'Channel name',
            'channel_description'  => 'Channel description',
            'user_id'              => 1,
            'subscription_count'   => 0
        ]);
    }
    /**
     * Create Episode test sample data
     */
    public function createEpisode()
    {
        return Episode::create([
            'episode_name'          => 'Episode name',
            'episode_description'   => 'Episode description',
            'channel_id'            => 1,
            'view_count'            => 0,
            'status'                => 1,
            'image'                 => 'dummy url',
            'audio_mp3'             => 'dummy url'
        ]);
    }
    /**
     * Create Comment test sample data
     */
    public function createComment()
    {
        return Comment::create([
            'user_id'    => 1,
            'episode_id' => 1,
            'comments'   => 'The new comment'
        ]);
    }
    /**
     * User login function
     */
    public function login()
    {
        $user = $this->createUser(3);
        $this->createChannel();
        $this->createEpisode();
        return Auth::attempt(['username' => 'test', 'password' => '<PASSWORD>']);
    }
}
{'fraction_non_alphanumeric': 0.1368620835090679, 'fraction_numerical': 0.008013496415014762, 'mean_word_length': 1.4323076923076923, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1317052', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1338, 'n_words': 301}