An optical sensor for detecting objects in a monitoring area, having a housing and a transmitting/receiving unit arranged within the housing, light beams emitted by a transmitter of the transmitting/receiving unit being guided perpendicularly within the monitoring area and passing through a disc, wherein light beams reflected back from an object are guided through the pane to a receiver of the transmitter/receiver unit and receiver signals of the receiver are evaluated in an evaluation unit for generating an object detection signal, and wherein a test unit is provided for checking the permeability of the pane, wherein the test unit has a plurality of test transmitters emitting test light beams arranged outside the housing offset in the circumferential direction thereof and at least one test detector arranged inside the housing, wherein the test light beams emitted by the test transmitter pass through different regions of the disc and are then guided onto the test detector arranged in a detector position, and wherein a reference measurement is carried out with the test transmitter or at least one further test emitted test light beams and the test detector or a further test detector, wherein for this purpose the test light beams emitted by a test transmitter are guided via a reference path to the test detector or to the further test detector, wherein a function check of components of the test unit is carried out in the evaluation unit on the basis of the received signals generated during reference measurements with the test detector or the further test detector, and in that a body which is associated with the test transmitter and rotates about an axis of rotation is present, which body has guide means for presetting the detection position, wherein the rotating body has a through bore forming the guide means, wherein, in rotational positions of the rotating body defining the detection positions, the test light beams emitted by a test transmitter pass through the through-bore and are guided to the or a test detector. wherein the test unit has a plurality of test transmitters emitting test light beams arranged outside the housing offset in the circumferential direction thereof and at least one test detector arranged inside the housing, wherein the test light beams emitted by the test transmitter pass through different regions of the disc and are then guided onto the test detector arranged in a detector position, and wherein a reference measurement is carried out with the test transmitter or at least one further test emitted test light beams and the test detector or a further test detector, wherein for this purpose the test light beams emitted by a test transmitter are guided via a reference path to the test detector or to the further test detector, wherein a function check of components of the test unit is carried out in the evaluation unit on the basis of the received signals generated during reference measurements with the test detector or the further test detector, and in that a body which is associated with the test transmitter and rotates about an axis of rotation is present, which body has guide means for presetting the detection position, wherein the rotating body has a through bore forming the guide means, wherein, in rotational positions of the rotating body defining the detection positions, the test light beams emitted by a test transmitter pass through the through-bore and are guided to the or a test detector.