DC Motor with Encoder (keeps giving 0s en 1s)

Hi, I bought this motor:
https://mijn-hebbeding.nl/Webwinkel-Product-212558579/12V%20320rpm%20-%2012V%20107rpm%20--6V-160rpm-DC-Gear-Motor-Encoder-Motor-Met-Montagebeugel-En-Wiel.html

And want to test it out with this library:

And this tutorial:

If I turn it around I only get

0
1
0
1
0
1

In my Serial Monitor. Also it does not matter if I turn clockwise or counter-clockwise.

It should be this:

What should I do to make it count when I am turning it?

Code:

/* Encoder Library - Basic Example
 * http://www.pjrc.com/teensy/td_libs_Encoder.html
 *
 * This example code is in the public domain.
 */

#include <Encoder.h>

// Change these two numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder myEnc(5, 6);
//   avoid using pins with LEDs attached

void setup() {
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");
}

long oldPosition  = -999;

void loop() {
  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
    Serial.println(newPosition);
  }
}

Try monitoring the encoder's 'A' and 'B' output phases with a DMM as you turn the motor by hand. Do they operate in the expected sequence?