CRUDlexTests\MySQLDataTest::testGet PHP Method

testGet() public method

public testGet ( )
    public function testGet()
    {
        $entity = $this->dataLibrary->createEmpty();
        $entity->set('name', 'nameC');
        $this->dataLibrary->create($entity);
        $id = $entity->get('id');
        $entityRead = $this->dataLibrary->get($id);
        $read = $entityRead->get('name');
        $expected = 'nameC';
        $this->assertSame($read, $expected);
        $entity = $this->dataLibrary->get(666);
        $this->assertNull($entity);
    }