<commit_before><?php
namespace mwhd\CFlashMessage;

require_once(__DIR__ . '/../../src/CFlashMessage/CFlashMessage.php');

class CFlashMessageTest extends \PHPUnit_Framework_TestCase
{
public function setup()
{
$this->flash = new CFlashMessage();
}
public function testClear()
{
$this->flash->message('info', 'Info type message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->flash->clear();
$this->assertEquals(null, $_SESSION['flash']);
}
public function testMessage()
{
$this->flash->message('info', 'Info example message');
$this->flash->message('danger', 'Danger example message');
$this->flash->message('success', 'Success example message');
$this->flash->message('warning', 'Warning example message');
$this->flash->message('something thats not a supported type', 'Should be info type message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->assertEquals('danger', $_SESSION['flash'][1]['type']);
$this->assertEquals('success', $_SESSION['flash'][2]['type']);
$this->assertEquals('warning', $_SESSION['flash'][3]['type']);
$this->assertEquals('info', $_SESSION['flash'][4]['type']);
$this->assertEquals('Info example message', $_SESSION['flash'][0]['message']);
$this->assertEquals('Danger example message', $_SESSION['flash'][1]['message']);
$this->assertEquals('Success example message', $_SESSION['flash'][2]['message']);
$this->assertEquals('Warning example message', $_SESSION['flash'][3]['message']);
$this->assertEquals('Should be info type message', $_SESSION['flash'][4]['message']);
}
public function testSpecificMessageFunctions()
{
$this->flash->info('Info example message');
$this->flash->danger('Danger example message');
$this->flash->success('Success example message');
$this->flash->warning('Warning example message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->assertEquals('danger', $_SESSION['flash'][1]['type']);
$this->assertEquals('success', $_SESSION['flash'][2]['type']);
$this->assertEquals('warning', $_SESSION['flash'][3]['type']);
$this->assertEquals('Info example message', $_SESSION['flash'][0]['message']);
$this->assertEquals('Danger example message', $_SESSION['flash'][1]['message']);
$this->assertEquals('Success example message', $_SESSION['flash'][2]['message']);
$this->assertEquals('Warning example message', $_SESSION['flash'][3]['message']);
}
public function testGetMessages()
{
$this->flash->clear();
$this->flash->message('info', 'Info example message');
$expectedResult = "<div class='alert alert-info'>\n";
$expectedResult .= "\t" . "Info example message" . "\n</div>\n";
$this->assertEquals($expectedResult, $this->flash->getMessages());
}
public function testEmptyGetMessages()
{
$this->flash->clear();
$this->assertEquals(null, $this->flash->getMessages());
}
}
<commit_msg>Update CFlashMessageTest.php<commit_after><?php
info', 'success', 'warning', 'error
namespace mwhd\CFlashMessage;

require_once(__DIR__ . '/../../src/CFlashMessage/CFlashMessage.php');

class CFlashMessageTest extends \PHPUnit_Framework_TestCase
{
public function setup()
{
$this->flash = new CFlashMessage();
}
public function testClear()
{
$this->flash->message('info', 'Info type message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->flash->clear();
$this->assertEquals(null, $_SESSION['flash']);
}
public function testMessage()
{
$this->flash->message('info', 'Info example message');
$this->flash->message('success', 'Danger example message');
$this->flash->message('warning', 'Success example message');
$this->flash->message('error', 'Warning example message');
$this->flash->message('something thats not a supported type', 'Should be info type message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->assertEquals('success', $_SESSION['flash'][1]['type']);
$this->assertEquals('warning', $_SESSION['flash'][2]['type']);
$this->assertEquals('error', $_SESSION['flash'][3]['type']);
$this->assertEquals('info', $_SESSION['flash'][4]['type']);
$this->assertEquals('Info example message', $_SESSION['flash'][0]['message']);
$this->assertEquals('Success example message', $_SESSION['flash'][1]['message']);
$this->assertEquals('Warning example message', $_SESSION['flash'][2]['message']);
$this->assertEquals('Error example message', $_SESSION['flash'][3]['message']);
$this->assertEquals('Should be info type message', $_SESSION['flash'][4]['message']);
}
public function testSpecificMessageFunctions()
{
$this->flash->info('Info example message');
$this->flash->danger('Success example message');
$this->flash->success('Warning example message');
$this->flash->warning('Error example message');
$this->assertEquals('info', $_SESSION['flash'][0]['type']);
$this->assertEquals('success', $_SESSION['flash'][1]['type']);
$this->assertEquals('warning', $_SESSION['flash'][2]['type']);
$this->assertEquals('error', $_SESSION['flash'][3]['type']);
$this->assertEquals('Info example message', $_SESSION['flash'][0]['message']);
$this->assertEquals('Success example message', $_SESSION['flash'][1]['message']);
$this->assertEquals('Warning example message', $_SESSION['flash'][2]['message']);
$this->assertEquals('Error example message', $_SESSION['flash'][3]['message']);
}
public function testGetMessages()
{
$this->flash->clear();
$this->flash->message('info', 'Info example message');
$expectedResult = "<div class='alert alert-info'>\n";
$expectedResult .= "\t" . "Info example message" . "\n</div>\n";
$this->assertEquals($expectedResult, $this->flash->getMessages());
}
public function testEmptyGetMessages()
{
$this->flash->clear();
$this->assertEquals(null, $this->flash->getMessages());
}
}

{'fraction_non_alphanumeric': 0.2368374401701826, 'fraction_numerical': 0.006736394256337529, 'mean_word_length': 9.998050682261209, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 117, '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': '6332335', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1560, 'n_words': 313}