Test the cable using the USB debugger mode on the smartphone. If the desktop/laptop detected the smartphone, the USB cable is a charging cable plus data cable
Another way to test is by observing the charging mode of the devices connected to the cable, if the device can be charge at 1/2a, that cable is a charging and data cable because the micro USB port on the device detected pin 4 which is the ID pin of the port. If a cable comes with ID pin, it must be a 4 wires USB cable with the D- and D+ pins for data transfer.