<commit_before><?php
namespace Respect\Validation\Rules;

class NullValueTest extends \PHPUnit_Framework_TestCase
{
    protected $object;

    protected function setUp()
    {
        $this->object = new NullValue;
    }

    public function testNullValue()
    {
        $this->assertTrue($this->object->assert(null));
        $this->assertTrue($this->object->validate(null));
        $this->assertTrue($this->object->check(null));
    }

    /**
     * @expectedException Respect\Validation\Exceptions\NullValueException
     */
    public function testNotNull()
    {
        $this->assertFalse($this->object->validate('w poiur'));
        $this->assertFalse($this->object->assert('w poiur'));
    }
}
<commit_msg>More null value tests through provider<commit_after><?php
namespace Respect\Validation\Rules;

class NullValueTest extends \PHPUnit_Framework_TestCase
{
    protected $object;

    protected function setUp()
    {
        $this->object = new NullValue;
    }

    public function testNullValue()
    {
        $this->assertTrue($this->object->assert(null));
        $this->assertTrue($this->object->validate(null));
        $this->assertTrue($this->object->check(null));
    }

    /**
     * @dataProvider providerForNotNull
     * @expectedException Respect\Validation\Exceptions\NullValueException
     */
    public function testNotNull($input)
    {
        $this->assertFalse($this->object->validate($input));
        $this->assertFalse($this->object->assert($input));
    }

    public function providerForNotNull()
    {
        return array(
            array(''),
            array(0),
            array('w poiur'),
            array(' '),
            array('Foo'),
        );
    }

}

{'fraction_non_alphanumeric': 0.14527421236872812, 'fraction_numerical': 0.0005834305717619603, 'mean_word_length': 2.720173535791757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '5392799', 'n_tokens_mistral': 471, 'n_tokens_neox': 473, 'n_words': 76}